Track custom events: sign-ups, purchases, clicks and outbound links
Page views tell you where people go. Events tell you what they do: submit a form, buy, download, or tap your WhatsApp button.
Automatic: outbound clicks
Without any setup, FastAnalytics records clicks on links to other websites as out:domain events (for example out:wa.me or out:instagram.com), and out:mailto / out:tel for email and phone links. Only the domain is recorded, never the full address.
To exclude a specific link, add data-hm-off to it.
Without code: the data-hm attribute
Add data-hm with an event name to any button or link. Each click sends that event:
<a href="/demo" data-hm="request-demo">Request a demo</a>
<button type="submit" data-hm="newsletter-signup">Subscribe</button>With JavaScript: hm()
Call hm() when something happens, for example after a form is sent successfully:
form.addEventListener('submit', function () {
hm('contact-form');
});If your code may run before the script has loaded, add this one-line queue first. Calls are kept and sent as soon as the script loads:
<script>window.hm=window.hm||function(){(window.hm.q=window.hm.q||[]).push(arguments)};</script>Naming events
- Short, lowercase, with hyphens:
signup,purchase,download-pricing-pdf. - Up to 64 characters.
- Never put personal data in an event name (emails, names, order IDs).
Events appear in your dashboard with their count and unique visitors, and you can filter any report by them.
FAQ
Can I send a value, like the purchase amount?
Yes, for purchases: hm('purchase', { revenue: 49.90 }) or data-hm-revenue="49.90". Only the amount is stored. See the revenue guide.