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.

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.

Onfus vs Hotjar

Does Onfus have heatmaps?

No. Onfus counts clicks you choose as events; use a heatmap tool alongside it if you need one.

Can I track outbound link clicks?

Yes. Add data-outbound-links to the Onfus script tag and clicks to other domains are sent with their URL.

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.