Skip to content

Tracking

How Fusionaly tracks user interactions

Page views and button clicks work as soon as you add the script. You do not need any configuration, attributes, or setup.

  • Page views: Every page load and every SPA navigation
  • Button clicks: Named from the visible text, for example button:submit, button:cancel_order

This follows convention over configuration. Fusionaly uses sensible defaults from the start.

To track something specific, add data-fusionaly-event-name to any element. The SDK picks the right behavior for each element type:

<button data-fusionaly-event-name="signup_clicked">Sign Up</button>
<a href="/pricing" data-fusionaly-event-name="pricing_viewed">Pricing</a>
<form data-fusionaly-event-name="contact_submitted">...</form>
<section data-fusionaly-event-name="testimonials_seen">...</section>
ElementTriggerNotes
ButtonClickOverrides the auto-generated name
LinkClickUses sendBeacon. Fires even if the user navigates away.
FormSubmitWorks on Enter key and button click. Button tracking is suppressed inside a form, so you do not get double events.
Any other elementScroll into viewFires when 50% of the element is visible in the viewport. Fires once per page load.

You use one attribute the same way everywhere.

To add context to an event, add data-fusionaly-metadata-* attributes:

<button data-fusionaly-event-name="revenue:purchased"
data-fusionaly-metadata-price="2999"
data-fusionaly-metadata-product="annual_plan">
Buy now
</button>
<a href="/trial"
data-fusionaly-event-name="trial_signup_clicked"
data-fusionaly-metadata-source="hero_cta">
Start Free Trial
</a>
<form data-fusionaly-event-name="demo_requested"
data-fusionaly-metadata-plan="enterprise">
...
</form>
  • Section Tracking: Fire events when visitors see specific sections (scroll into view at 50% visibility)
  • Revenue Tracking: Track purchases with data-fusionaly-event-name="revenue:purchased" and price/currency metadata

For dynamic data that HTML attributes cannot express, use the JavaScript API:

Fusionaly.sendCustomEvent("video_completed", {
videoId: "demo",
watchTime: 120
});

Use data attributes for most tracking. Use the JavaScript API only when HTML attributes are not enough.