Tracker

MIT

Tracker script

A ~1 KB cookieless script. One tag before </head>. No cookies, no localStorage identifiers, no fingerprints.

v5.js is the browser half of Vector 5. It counts people who execute JavaScript. Crawlers that never run JS are the middleware's job.

Install

index.html
<script defer data-domain="example.com"
  src="https://analytics.example.com/js/v5.js"></script>

The API serves the script at /js/v5.js (5-minute cache). You can also vendor packages/tracker/dist/v5.js and point data-api at your ingest host.

What it sends

FieldJSON keySource
Domainddata-domain or location.hostname
Event namenpageview unless you pass one
URLulocation.href
Referrerrdocument.referrer
Hostnamehlocation.hostname
Screen widthwscreen.width
PropspOptional object from window.v5
UTMsutm_*From location.search if present

The server derives referrer host, country, device, browser, and OS, then discards the IP. The script never sends a visitor id.

Automatic events

  • Pageviews on load, pushState, replaceState, and popstate.
  • Hash changes when data-hash="true".
  • Outbound Link on clicks to another host.
  • File Download for pdf, zip, csv, xlsx, docx, png, mp4.
  • `data-v5-event` on any clicked element.

Ignore yourself

devtools
localStorage.v5_ignore = '1'

The script reads that key once at boot and exits. It is the only localStorage access, and it is opt-in on your machine. Ignore visits.

Something off? Open an issue · Edit on GitHub