Analytics & Leads > Event Tracking

Online Event Tracking

Track on-page interactions in real time using the SuperFunnel JavaScript event API.

Overview

Online event tracking lets you record visitor interactions that happen directly on your page — clicks, scroll milestones, partner link clicks, and any other custom engagement signal. Events are automatically linked to the visitor's session, so they appear alongside other analytics for that visit.

Common uses:

  • Button and CTA clicks
  • Outbound and affiliate link clicks
  • Scroll depth milestones
  • Micro-conversions before form submission
  • Custom widget interactions

Display events as columns

To have a SuperFunnel event you're capturing appear as a column in your Pages view, reach out to support@superfunnel.ai — this currently requires a manual configuration. For events tracked through external services such as Google Tag Manager or Pixel, we can also help with setup.

Default conversion events

Every SuperFunnel page emits two built-in conversion events. You can use either as a trigger in Google Tag Manager, a pixel, or your own scripts:

EventFires whenScope
superfunnel-conversionAny conversion happens, including a click-out (a tracked outbound link or CTA click) or a form submissionBroad
superfunnel-form-submissionA visitor reaches the Final Step of a form or quizNarrow

A form submission means the visitor reached a Final Step. Every form and quiz should have a Final Step; without one, superfunnel-form-submission never fires and your completers go uncounted. Visitors who leave before the Final Step are recorded as partial leads instead.

If a high-converting quiz shows 0 Form Submissions, it usually means your real conversion happens before the final step, for example an email capture mid-quiz, so visitors never trigger superfunnel-form-submission.

Converting before the Final Step?

When a visitor becomes a complete lead before the final step, fire your own custom event at the exact moment that matters (shown below).

To count the moment that matters to you, fire your own event with window.sf.reportEvent() at that point. The example below reports a submit-email event the first time the visitor's email field has a value, regardless of which step they're on:

<script>
  (function() {
    var reported = false;

    function onStepChange() {
      if (reported) return;
      // getValue('email') reads the value of the SuperFunnel email field.
      if (getValue('email')) {
        window.sf.reportEvent('submit-email');
        reported = true; // fire once per session
      }
    }

    window.addEventListener('sf:step-change', onStepChange);

    return function() {
      window.removeEventListener('sf:step-change', onStepChange);
    };
  })();
</script>

Because it checks only for a value in the email field — never a specific step — it keeps working if steps are renamed, reordered, or restructured.

How It Works: SuperFunnel Example

SuperFunnel automatically exposes a global JavaScript function on every page:

window.sf.reportEvent(eventName);

Call this function whenever a user action occurs that you want to track. No setup or configuration is required — the function is always available.

ParameterTypeDescription
eventNamestringThe name of the event to record. Use a short, descriptive slug.

Examples

Track a CTA button click

window.sf.reportEvent("cta-click");
window.sf.reportEvent("partner-click");

Typical uses: affiliate links, marketplace links, outbound referrals.

Track scroll depth

window.sf.reportEvent("scroll-depth-75");

Call this when the user scrolls past a threshold you define in your page's JavaScript.

Where to Add This Code

You can call window.sf.reportEvent() from any JavaScript running on your page:

  • Custom HTML sections
  • HTML Stepper final steps
  • Custom widgets
  • Any inline <script> block on the page

Order matters

Scripts ran in the body of a page should be deferred 1 ms or placed at the end of the page. Running scripts prematurely may prevent them from picking up on an event.

Verify events are firing

Open your browser console on the live page to watch events as they're reported. See Debugging & Session IDs for what each logged event contains and how to read per-session identifiers.

What's Next