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:
| Attribute | Default | Effect |
|---|---|---|
| data-domain | required | The site’s public domain, exactly as registered here |
| data-api | script origin + /api/ev | Send events elsewhere — used for first-party proxying |
| data-spa | on | Set to "off" to stop counting client-side navigations |
| data-hash | off | Set to "true" for hash-routed apps (#/page) |
| data-exclude | none | Comma-separated path globs to skip, e.g. /admin/*,/preview |
| data-respect-dnt | off | Set to "true" to honour Do Not Track and Global Privacy Control |
| data-localhost | off | Set 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.