Exclusions, Domains & Bot Filtering
Exclude your own visits, restrict ingestion to approved hostnames, skip specific links, and see how TrimStats drops bots before billing.
How does TrimStats filter bots, crawlers, and internal team traffic?
TrimStats drops automated bots, headless webdrivers, and known crawlers on the Fastify collector before ClickHouse writes or monthly billing counters increment. Site owners also enforce strict allowed-hostname lists per site key and exclude internal developer browsers via localStorage.setItem("trimstats_ignore", "1").
Exclude your own browser
Prevent your own team visits from skewing analytics by setting the trimstats_ignore flag in localStorage on your domain. Whenever this key holds any truthy value, t.js exits immediately before sending any beacons.
1// Stop tracking this browser on the current domain2localStorage.setItem('trimstats_ignore', '1');34// Re-enable tracking later5localStorage.removeItem('trimstats_ignore');Exclude specific links
Add data-ts-ignore to any anchor tag whose clicks should not generate automatic outbound or download events.
<a href="https://status.acme.com" data-ts-ignore>System Status</a>Allowed hostnames enforcement
Under Site settings -> General & Privacy -> Allowed hostnames, enter a comma-separated list of authorized domains (for example acme.dev, docs.acme.dev).
403 Forbidden before touching your monthly event quota.- Subdomains are matched automatically: allowing
acme.compermitsacme.com,www.acme.com, andapp.acme.com. - Requests whose page URL hostname is not on the allowlist are rejected with HTTP 403 Forbidden before touching Redis or counting against your monthly event quota.
- This prevents accidental staging pollution or someone copying your public
pk_live_...snippet onto an unrelated domain.
Automatic bot & crawler filtering
TrimStats filters non-human traffic at two layers so crawlers never inflate metrics or consume billable event quota:
| Layer | Detection signal | Behavior |
|---|---|---|
Browser (t.js) | navigator.webdriver === true | Exits immediately before sending any network request (covers Playwright, Puppeteer, Selenium, and headless CI runs). |
Collector (/v1/collect) | Empty or < 8 character User-Agent, plus regex covering search, social, uptime, SEO, HTTP clients, and AI crawlers (GPTBot, ClaudeBot, PerplexityBot, Googlebot, Bingbot, AhrefsBot, SemrushBot, HeadlessChrome, Lighthouse, curl/, wget/, python-requests, go-http-client, and more) | Returns 202 Accepted immediately before Redis quota increment or human event writes; recognized AI crawlers are routed separately to crawler_events. |
Common technical questions
Do filtered bots and search crawlers count against my TrimStats event quota?
How do I stop my own staging or admin visits from skewing production stats?
Related guides
Confirm events are reaching ClickHouse and diagnose common setup issues like 403 domain blocks, ad blockers, or missing data attributes.
Compare Starter, Growth, and Scale limits, see which events count toward monthly quotas, and learn how the 20% spike grace buffer works.
Complete reference for every HTML data attribute supported by t.js, including first-party mode, UI friction, and custom proxy endpoints.