Skip to content

Tracking

How Fusionaly tracks user interactions

Page views and button clicks are tracked the moment you add the script. No configuration, no attributes, no setup.

  • Page views: Every page load and SPA navigation
  • Button clicks: Named from visible text — button:submit, button:cancel_order, etc.

That’s convention over configuration. The right defaults, out of the box.

When you want to track something specific, add data-fusionaly-event-name to any element. The SDK does the right thing based on 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
FormSubmitEnter key and button click both work. Button tracking is suppressed inside — no double events
Any other elementScroll into viewFires when 50% of the element is visible in the viewport. Fires once per page load

One attribute. Same everywhere. The SDK does the right thing based on element type.

Need more context? Add data-fusionaly-metadata-* attributes:

<button data-fusionaly-event-name="revenue:purchased"
data-fusionaly-metadata-price="2999"
data-fusionaly-metadata-product="pro_plan">
Upgrade to Pro
</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 can’t be expressed in HTML attributes, use the JavaScript API:

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

Most tracking should use data attributes. The JS API is for the cases where HTML isn’t enough.