Custom events
Pageviews are tracked for you. A custom event is anything else you want to count: a signup, a purchase, a button click or a file download.
Send an event
JavaScript
weblytic360('signup');Add details with a second argument:
With properties
weblytic360('purchase', { plan: 'pro', value: 19 });From a button or a link
HTML
<button onclick="weblytic360('download')">Download the guide</button>Before the script has loaded
The tracking code you copy from Settings includes a small stub, so you can call weblytic360(...) at any time. Calls made before the script finishes loading are queued and sent right after.
Where to see your events
Events appear in the Events panel of your dashboard and in the Events reports in the menu, with a count for each event name.
Good habits
- Use short, lowercase names, such as
signupornewsletter_subscribe. - Keep the number of different names small, so your report stays readable.
- Never put personal data, such as an email address or a name, in an event name or its properties. See the terms.
- Every custom event counts as one event in your plan, just like a pageview.
Send a pageview yourself
With the manual script, weblytic360('pageview') sends a pageview. The tracking code from Settings already calls it once per page load. In a single-page app, use the automatic versioninstead.