Every visit, one path.
Each page in order, with read time and scroll depth. identify joins the visits into one person.
trail.identify("user_1204")Joins this browser's visits into one person.The smallest tracker that still shows each visitor's whole path. Private until they say yes. One binary on your server.
Paste one line. Watch the first visitor arrive. Name the moment that matters.
Paste the snippet. The Install panel turns green when the first event lands.
<script defer
src="https://stats.example.com/_t/t.js"
data-site="mysite"
data-api="https://stats.example.com/_t/e">
</script>Pages, read time, outbound clicks and identify, in the order the visitor made them.
A goal is a page or an event. Trail counts who reached it and their share of everyone.
Every visit on one sheet: where they came from, each page in order, how long they read and when they signed up.
Recreated in HTML from the dashboard's Visitors tab.
Each page in order, with read time and scroll depth. identify joins the visits into one person.
trail.identify("user_1204")Joins this browser's visits into one person.Anyone active in the last five minutes.
A page or an event, with its rate against last period.
Add data-trail to any element. No JavaScript.
Works after consent or in full mode.
<button data-trail="Copy Code">
Copy
</button>Events from any other origin get a 403.
3 events rejected from other origins.
Failed sends retry up to five times.
A retry means the first send failed, often on a weak mobile connection.
Pick a mode. On the left, what Trail writes in the visitor's browser. On the right, what you can see.
<script … no data-mode>Nothing is stored in the browser until you call trail.consent(true). Until then, visits are counted but not joined.
Three visits, three strangers. Accept analytics on the left to see what changes.
trail.consent(false) wipes the ids and stops sending.Do Not Track and GPC mean nothing is sent.Raw IPs never touch the disk.Sizes are gzip level 9.
t.p.jst.jsA static Go binary with the dashboard inside. SQLite runs in the same process, so there is nothing else to install.
$ docker run -d -p 8080:8080 -v trail-data:/data \ -e TRAIL_PASSWORD=… -e TRAIL_SITES=mysite=example.com ghcr.io/karanjot786/trail3f9c2a1e8b7d41c6a0e5d2b9$ docker logs 3f9c2026/11/20 09:14:02 trail listening on :8080 (sites: 1, api tokens: 0)$
Waiting for the first event…
docker run -d --name trail -p 8080:8080 -v trail-data:/data \
ghcr.io/karanjot786/trail
docker logs trail 2>&1 | grep 'Log in' # generated passwordThe -wal and -shm files are SQLite's working files while Trail runs.
Every event, goal and site lives in trail.db. Back it up with .backup while Trail runs. Stop Trail and copy it to move servers.
sqlite3 trail.db ".backup backup.db"Trail serves MCP at /mcp. Add it to Claude Code once, then ask in plain words.
claude mcp add --transport http trail \
https://stats.example.com/mcp \
--header "Authorization: Bearer <read-token>"Read-only token. The tools read your stats. They cannot change goals, sites or settings.
Which pages brought signups this week?
{site: "mysite", range: "7d"}[
{ "name": "Signup", "kind": "event",
"visitors": 39, "rate": 0.044,
"prev": { "visitors": 30, "rate": 0.036 } },
{ "name": "Install docs", "kind": "page",
"match": "/docs/installation",
"visitors": 212, "rate": 0.237,
"prev": { "visitors": 154, "rate": 0.172 } },
{ "name": "Pricing page", "kind": "page",
"match": "/pricing",
"visitors": 96, "rate": 0.107,
"prev": { "visitors": 101, "rate": 0.118 } }
]39 people signed up this week, up from 30. Here are your page goals over the same week:
| Page | Visitors | Last week |
|---|---|---|
/docs/installation | 212 | 154 +38% |
/pricing | 96 | 101 −5% |
goal_report counts each goal on its own, so it can't tell which page came before a signup. Want me to read the signups' journeys with get_journey and check the last page before each one?
In the default mode the tracker writes nothing to the browser until you call trail.consent(true) or trail.identify(). Until then it stores no cookie and no localStorage. Whether your site needs a banner for other reasons is a question for your own legal advice.
Serve the tracker and its endpoint from your own domain with a /_t/* rewrite. The browser then sees a first-party script and a first-party request.
One machine that can run a static Go binary, or Docker. The database is SQLite inside the same process, so there is nothing else to install or keep running.
All data is one SQLite file. Snapshot it with sqlite3 .backup on a schedule, and copy the file to move to a new server.
Yes. List them in TRAIL_SITES as id=domain pairs, or add them in Settings, and switch between them in the dashboard.
Nothing. Trail is MIT licensed and there is no hosted plan or paid tier. You pay only for the server you run it on.
Read-only, with generated data. No sign-up.