Install the browser tracker

The one line install, what the tracker collects, what it deliberately does not, and how to confirm it is working.

Last updated

The script tag

Add one line before the closing head tag of every page. Your site id is on the settings screen inside the app.

Install snippet
<script defer data-site="YOUR_SITE_ID" src="https://cdn.truevisit.ai/tracker.js"></script>

The tracker is 1.48 KB gzipped, has no dependencies, and posts a content type that needs no CORS preflight, so it costs your pages one request and no round trip before it.

What it collects

  • The page URL, referrer, page title, and browser language.
  • Screen size, and whether a pointer moved, the page was scrolled, and how long the visit lasted. These are detection layer 3 signals, not engagement metrics.
  • The value of the webdriver flag, which is how a browser reports that it is being automated.
  • Outbound link clicks and form submits, captured automatically. Form submits record the form id or name and never a field value.

What it never does

  • It sets no cookies and writes nothing to localStorage or sessionStorage. Visitors are counted with a hash computed on our server that rotates daily.
  • It never sends what a visitor typed into a form.
  • It does not run on localhost or a file URL unless you opt in with data-local="true", so a preview environment cannot pollute your numbers.

Because the tracker is cookieless and stores nothing in the browser, a cookie consent banner is not required for it. The tradeoff is deliberate: a returning visitor on a later day counts as a new visitor.

Confirming the install

  1. Add the script and load any page of your site once in a normal browser.
  2. Open the settings screen in the app. The install check reports the time of the first event it received.
  3. If nothing arrives within a minute, check that the site domain you registered matches the domain in the browser address bar. Events from an unregistered domain are rejected on purpose, so that nobody can push fake data into your stats.

Turning off automatic events

If your site already fires its own outbound click or form events, add data-auto-events="false" to the script tag so the same action is not counted twice. Your own events still work through window.truevisit().

A custom event
window.truevisit('newsletter_signup');