TapCub is live — analytics, insights and live chat, free on one platform
Help center

How do I track button clicks?

Track a button with no code by naming its clicks in the event inbox, which also fills in the last 90 days, or send an event from code. Which to choose and what is never captured.

Product analytics1 min readLast updated Nov 4, 2026TapCub teamPart of Autocapture and the AI event inbox

Still have a question?

Could not find it? A person reads every message, usually within a few hours on business days.

Chat with us

Short answer

With autocapture on (Pro plan and above), accept the button’s candidate in the event inbox and name it; that also fills in the last 90 days. Or call tapcub.track() in the click handler when you need extra properties.

Two ways

MethodCode neededHistory
Autocapture + event inboxNoneAccepting a rule backfills the last 90 days
tapcub.track() in your click handlerYesFrom the day you deploy

With autocapture (no code)

  1. Turn on autocapture in the autocapture card under Web analyticsConfigurationSDK code. Autocapture is included from the Pro plan.
  2. Wait for candidates, or generate them right away in All-platform analyticsDataEvent inbox. Clicks are grouped by element and page.
  3. Accept the button's candidate and give it a snake_case name such as start_trial_click, or merge it into an existing event.

Accepting creates a rule and fills in the last 90 days, so you can see how the button performed before you asked. More in how autocapture works.

With code

Call tapcub.track in the button's click handler:

document.querySelector('#start-trial').addEventListener('click', () => {
  tapcub.track('start_trial_click', { location: 'pricing' });
});

Choose code when you need properties autocapture cannot see, such as the selected plan, or when the plan does not include autocapture.

What is never captured

Autocapture skips password fields, anything inside an element with data-tc-ignore, the chat widget and selectors on your deny list. Element text is off by default.

See where people click

Clicks also feed heatmaps. A heatmap shows every clickable element on a page at once, plus rage clicks. Heatmaps are under All-platform analyticsBehaviorHeatmaps.

Confirm it works

Do the action yourself on the live site, then open Web analyticsRealtime: the event appears within a few seconds. Totals and properties are in Web analyticsEvents.

See also: track form submissions and micro-conversions.

Did this answer your question?

We use your answers to fix and expand this page.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics