Install the tracking tag

One script line, every configuration attribute, and what to check when nothing arrives.

The browser tag is a single script with no dependencies, around 0.9 KB gzipped. Put it in the head of every page you want measured.

<script defer data-domain="example.com" src="https://causalit.fr/js/s.js"></script>

It fires a pageview on load and on every subsequent client-side navigation. That is the whole install.

Configuration

Everything is a data attribute on the script tag itself:

AttributeDefaultEffect
data-domainrequiredThe site’s public domain, exactly as registered here
data-apiscript origin + /api/evSend events elsewhere — used for first-party proxying
data-spaonSet to "off" to stop counting client-side navigations
data-hashoffSet to "true" for hash-routed apps (#/page)
data-excludenoneComma-separated path globs to skip, e.g. /admin/*,/preview
data-respect-dntoffSet to "true" to honour Do Not Track and Global Privacy Control
data-localhostoffSet to "true" to also count localhost — useful while developing

What is never counted

  • Automated browsers, detected via navigator.webdriver.
  • localhost, 127.0.0.1 and ::1, unless you opt in with data-localhost.
  • Pages the browser is speculatively prerendering — a prerender is not a visit.
  • Any path matching data-exclude.

If nothing arrives

  • Check that data-domain matches the domain registered here, character for character.
  • Open your browser’s network tab and look for a request to /api/ev after a page load.
  • If the request is missing entirely, an ad blocker is very likely eating it — see the first-party proxy guide.

Start free

Install the tracking tag — causalIT