Skip to content

Configure the tracking script

Choose per-site tracker features and override supported options in the script tag.

Configure automatic tracking for one site, then use script attributes only where the page needs an override.

  1. Open Settings → Tracking, choose the tracker features, then select Save tracking settings.

    Setting Default Script override
    Track outbound links on data-outbound="false"
    Track file downloads on data-downloads="false"
    Track form submissions on data-forms="false"
    Track Web Vitals on data-vitals="false"
    Track 404 pages on data-404="false"
    Track hash routes off data-hash="true"
    Track heatmap clicks follows Collect click heatmaps data-heatmap="false"
  2. Add other supported options to the generated script when needed.

    Attribute Purpose
    data-api="https://analytics.example.com/api/public/v1/events" Override the event endpoint.
    data-manual="true" Wait for supermetry.pageview() instead of sending automatically.
    data-consent="required" Queue events until supermetry.consent(true).
    data-before-send="filterEvent" Call a named global function before each send.
    data-download-ext="pdf,zip" Replace the automatic download-extension list.
    data-allow-localhost Allow tracking on localhost, which is otherwise skipped.
    data-clicks="false" Disable custom events declared on HTML elements.
    data-404-page Mark the current page as a 404 page.
    data-supermetry-event="Signup" Name an event on a clicked or submitted element.
    data-supermetry-prop-plan="pro" Add a property to that HTML-declared event.

    For example:

    <script defer data-hash="true" data-consent="required" src="https://analytics.example.com/js/YOUR_SITE_ID.js"></script>
  3. Leave data-site for the shared /js/script.js and /js/script.full.js assets only. Per-site generated URLs already embed the site ID. Supermetry generates data-profiles, data-replay, and data-tracking from server policy; do not set them in the snippet.

What you should see: after the script cache refreshes, new visits follow the saved settings and any tighter snippet overrides.