Add Millimetry to a website
The tracker is one script, about 0.7 KB compressed. It sends a page view when a page loads and on every single-page-app navigation, and the custom events you send.
It never sets cookies. It writes nothing to localStorage, sessionStorage, IndexedDB or any cache, and it reads no fingerprinting signals (canvas, audio, fonts, plugins). It does nothing on localhost, 127.0.0.1 or file: pages, in automated browsers, or on a prerendered page until someone sees it.
1. Create the site
Section titled “1. Create the site”In the dashboard, choose Add an app or site, name the site, and add every origin it is served from, such as https://example.com and https://www.example.com. Millimetry refuses events from any other origin. Copy the site key (wk_…).
2. Add the script
Section titled “2. Add the script”Add one line to every page, for example in your layout’s <head>:
<script defer src="https://e.millimetry.app/s.js" data-key="wk_…"></script>That’s all. Page views appear in the dashboard’s live view within seconds.
If your visitors use ad blockers, consider serving the script from your own domain: see proxied installs.
Custom events
Section titled “Custom events”window.millimetry("signup_click", { plan: "pro" });Calls made before the script has loaded are kept if you add this line before the tracker:
<script>window.millimetry=window.millimetry||function(){(window.millimetry.q=window.millimetry.q||[]).push(arguments)}</script>Event names are 1 to 64 characters. pageview and names starting with $ are reserved. Properties are strings, numbers or Booleans, up to 25 per event. Never send personal data.
What is stored
Section titled “What is stored”From each page view:
- the hostname and path;
- the referring site’s name (
Google,news.ycombinator.com), never its full URL; utm_source,utm_mediumandutm_campaign, and no other part of the query string or fragment;- the browser and OS with their major versions;
- a screen-size class (mobile, tablet, laptop, desktop);
- the country and region.
Visits are grouped into sessions on the server. A session ends after 30 minutes without a page view.