Click tracking
Click tracking records which links and buttons visitors click. There are two ways to do it: send a named event for the clicks you care about, which gives exact counts you can use as goals, or record every click for a heatmap or session replay, which shows patterns on a page. Event-based click tracking is lighter and works without cookies.
By the Onfus teamUpdated 17 November 2026
Click tracking
- Definition
- Recording which links and buttons visitors click, either as counted events or as heatmaps and recordings.
How do you track button clicks?
Attach an event to the button, either with a JavaScript call in its click handler or with a data attribute that your analytics script listens for. Give the event a clear name (Pricing CTA Click) and, if needed, a property that says which button it was.
| Method | What you get | Trade-off |
|---|---|---|
| Click events | Exact counts per named click, usable as goals | You choose which clicks to track |
| Heatmaps | A picture of where people click on one page | Usually a separate tool and script |
| Session replay | Recordings of individual visits | Heavier script, more privacy review |
- Click events
- What you getExact counts per named click, usable as goals
- Trade-offYou choose which clicks to track
- Heatmaps
- What you getA picture of where people click on one page
- Trade-offUsually a separate tool and script
- Session replay
- What you getRecordings of individual visits
- Trade-offHeavier script, more privacy review
Three ways to track clicks
Questions about click tracking.
Should I use click events or heatmaps?
Use click events when you need numbers: how many visitors clicked the trial button, and how many of them signed up. Use heatmaps when you're redesigning one page and want to see where attention goes. Many sites run both.
How does Onfus handle it?
Onfus tracks clicks as events: add data-onfus-event="Trial Click" to a button, or switch on data-outbound-links to count clicks to other sites as Outbound Link: Click with the URL. Onfus has no heatmaps or session replay.
Does Onfus have heatmaps?
Can I track outbound link clicks?
Know what to fix by tomorrow.
Paste one line and start tracking in a minute. See where visitors drop off and what to fix. Free for 14 days, no cookie banner.