Script configuration

Configure tracking with attributes, not code.

The tracking script reads `supr-*` attributes on its tag and on your elements, and `window.supr()` covers the rest: goals, identification, manual pageviews and the visitor id for checkouts.

14-day free trial · No card required · From $9/month

On the script tag.

Only supr-website-id is required. The rest change how visitors are counted and where events go.

supr-domain
Sets the visitor cookie on your main domain, so www., app. and other subdomains count as one visitor.
supr-allowed-hostnames
Your other domains, comma-separated. Links between them keep the same visitor, so a payment on one credits visits on another.
supr-api
Where events are sent: a full URL or a path on your website, for serving through your own proxy.
supr-hash and supr-allow-localhost
Count #/route changes as pages, and record localhost while you test.
supr-cookieless
Sets no cookies at all; visitors are recognised with a daily hash instead.
supr-outbound, supr-polar, supr-dodo, supr-paddle
Set to false to stop tracking outbound clicks, or to stop adding the visitor id to that provider's checkout links.

On your elements.

Goals and privacy settings straight in your HTML, with no JavaScript.

supr-goal
A click on the element completes the goal: <button supr-goal="start_trial">. Each supr-goal-* attribute becomes a property.
supr-scroll
The goal completes when the element scrolls into view, with supr-scroll-threshold for how much must show and supr-scroll-delay for how long.
supr-mask and supr-block
Hide an element's text, or leave it out entirely, in session recordings and heatmap snapshots.

From JavaScript.

One global function, window.supr, for what attributes can't do.

  • window.supr("signup", { plan: "pro" }) completes a goal with up to 10 properties
  • window.supr("identify", { user_id, email, name }) names the visitor: see user identification
  • window.supr("pageview") sends a pageview, for a router the script can't see
  • window.supr.visitorId() and window.supr.sessionId() return the ids to pass to a checkout

A one-line stub in the <head> queues calls made before the script has loaded. The docs have it.

How it works, in detail.

The docs page “Script configuration” goes through it step by step.

How it works

Limits worth knowing

  • No automatic download tracking: add supr-goal to a download link to count its clicks
  • Goal names are lowercased, spaces become underscores, and they're cut at 64 characters
  • Up to 10 properties per goal, with keys up to 32 characters and values up to 255
  • Optimisation plugins that strip unknown attributes can break the tag; check the page source still has supr-website-id

Questions, answered.

Which attribute is required?

Only supr-website-id, which says which website the visits belong to. Everything else has a default.

Are outbound links tracked?

Yes. Clicks on links to other websites are tracked on their own, unless the tag has supr-outbound="false".

Are file downloads tracked?

Not on their own. Add supr-goal="download_pdf" to the link, and each click completes that goal.

Can I leave my own visits out?

Yes. Open your website with #supr-ignore at the end of the address, or ?supr_ignore=true, and that browser is left out from then on. #supr-track undoes it.

Can I track without cookies?

Yes. supr-cookieless="true" sets no cookies and recognises visitors with a daily hash. The trade-offs are in cookieless tracking.

See it on your own website.

Every feature is on every plan, with a free trial and no card.

14-day free trial · No card requiredPricingHow it worksAll features