Events and goals
Updated October 14, 2026
Pageviews tell you where people go. Events tell you what they do: sign up, buy, send a form, click a button. Statsdot does not need you to create an event beforehand. Your site sends it with a name, and it shows up in the Events panel of the dashboard a few seconds later.
Without code
Add the data-statsdot-event attribute to a button, a link or a form, with the name of the event:
<button data-statsdot-event="Signup">Create account</button>
<a href="/pricing" data-statsdot-event="See pricing">Pricing</a>
<form data-statsdot-event="Contact">...</form>
- A button or a link sends the event when it is clicked.
- A form sends it when it is submitted. If the browser stops the form because a required field is empty, nothing is sent.
- Add
data-statsdot-label="..."to send a detail with it, for example which button of the page was used.
This works in any builder that lets you add an HTML attribute: WordPress, Webflow, Shopify or your own code.
With JavaScript
Call window.statsdot.track when the action happens, for example after your server confirms a purchase:
window.statsdot.track('Purchase')
window.statsdot.track('Purchase', 'Yearly plan')
The second value is the label. Click an event in the dashboard to see its labels.
Events counted for you
Clicks on links to other websites and on files such as PDF, ZIP or DOCX are counted as Outbound Link and File Download without any code. To turn this off, add data-auto="false" to the script tag.
Naming events
- Use the same name everywhere, with the same capitals:
Signupandsignupare two different events. - Keep names short, up to 64 characters, and labels up to 512.
- Never put personal data in a name or a label: no email addresses, names or order numbers that point to a person. Statsdot is built to work without personal data, and your events should be too.
Goals and conversion rate
A goal is a page or an event you care about. Add it in the Settings of the site, the cog next to the dates in the dashboard:
- Event: the exact name you send, such as
Signup. - Page visit: a path such as
/thanks.
The dashboard then shows, for the selected period, how many visitors reached each goal and the conversion rate: those visitors out of all visitors. Click a goal to filter the whole dashboard by the people who reached it.
Check that it works
Open your site in a normal browser window, use the button or the form, and look at the Events panel. If nothing arrives:
- make sure the Statsdot script is on that page;
- if you excluded your own browser with
statsdot_ignore, your clicks are not counted, by design; - on
localhostthe script does not send anything.
New to Statsdot? Start with installing the script.