Quickstart
Three ways to send events: curl (or any HTTP client), the browser SDK, the Node SDK, or an AI agent via MCP. They all hit the same API.
1. Get an API key
In the dashboard, create a project. You'll get three keys:
pk_live_…
browsers (origin-restricted)
ingest only
sk_live_…
servers, scripts, anywhere private
ingest only
rk_live_…
servers, MCP clients, dashboards
read only
Add your site's origin to the project's allowlist before using pk_* keys from a browser.
2. Send your first event
curl
curl -X POST https://api.millimetric.ai/v1/track \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"event": "signup",
"anonymous_id": "u_abc",
"user_id": "user_42",
"url": "https://yoursite.com/?utm_source=facebook&utm_medium=cpc",
"properties": { "plan": "free" }
}'Browser — snippet (any HTML page)
What you get automatically:
$pageviewon load and every SPA route changeanonymous_idinlocalStorage(no cookies)Captures
utm_*,fbclid,gclid,ttclid,msclkid,li_fat_id, viewport, language, timezoneRespects DNT / Global Privacy Control
Batches events; flushes on
pagehideviasendBeacon
Browser — npm (React / Next / Vue / Svelte)
Node / Bun
AI agent via MCP
Point any MCP-speaking agent at https://api.millimetric.ai/mcp with a Bearer token. Only server-side keys are accepted — pk_* is rejected because it's designed to ship in browser JS. Tools available:
track_event(requires ansk_*oradminkey)query_events,get_stats,top_sources(rk_*)
Example tool call:
3. Query your data
4. Privacy operations
How attribution is classified
Every event runs through a server-side classifier that turns raw utm_*, click IDs, and referrer into a clean (source, medium, confidence) tuple. The rules cascade, first match wins:
gclid/msclkid/ttclid/li_fat_id⇒ network / paid / high.fbclidarriving vial.facebook.comorlm.facebook.com⇒ facebook / paid / high (Meta's ad-redirect hosts).fbclid+utm_source=facebook|instagram|meta⇒ facebook|instagram / paid / high.utm_medium=cpc|paid|paid_social|cpm|display|retargeting⇒ paid / high.fbclidalone, no other context ⇒ facebook / paid / medium (fbclidcan leak onto organic shares but the dominant case is ad clicks).Explicit
utm_sourcewith no paid signal ⇒ source / utm_medium / high.Referrer ∈ Facebook hosts without
fbclid⇒ facebook / social / medium.Other known social referrers (twitter, linkedin, reddit, tiktok, youtube, pinterest, …) ⇒ source / social / medium.
Search engines (google.*, bing, duckduckgo, …) ⇒ source / organic / medium.
Email clients / ESPs ⇒ email / email / medium.
Same-host referrer ⇒ internal / direct / high.
No referrer & no UTM & no click ID ⇒ direct / direct / high.
Otherwise ⇒ slug of referrer host / referral / low.
The matching rule's id is stored on every event so you can audit or re-classify later.
Last updated
Was this helpful?