Excluding traffic
Keep your own visits, internal pages and bots out of your stats.
Exclude yourself
Run this once in the browser console on your site. The tracker checks the flag on every page load and sends nothing from that browser while it's set (any value counts):
localStorage.setItem("stancelens_ignore", "true");Remove it with localStorage.removeItem("stancelens_ignore").
Exclude pages
Two options. In the script tag, data-exclude takes comma-separated paths where * matches anything; the tracker sends nothing on matching pages:
<script defer data-site="SITE_ID" data-exclude="/admin/*,/preview/*,/account" src="https://stancelens.com/e.js"></script>Or add patterns under Site settings → Exclusions → Pages (up to 100). These are applied on the server to every source, SDKs and the API included. There, * matches within one path segment and ** matches across segments; a pattern ending in /* also excludes everything below it.
Exclude IP addresses
Under Site settings → Exclusions → IP addresses, add up to 100 rules: single IPv4 or IPv6 addresses (203.0.113.7, 2001:db8::1), IPv4 ranges in CIDR form (10.0.0.0/8), or prefixes ending in * at a dot or colon (10.0.*, 2001:db8:*). IPv6 CIDR ranges aren't supported; use a prefix instead. Matching hits are dropped at ingestion and never stored. The IP is compared in memory and never written down.
Allowed hostnames
By default, web events are accepted from any hostname, so someone who copies your snippet onto another site adds to your stats. Under Site settings → Exclusions → Allowed hostnames, list the hostnames that may send page views and events: acme.com matches exactly that host, and *.acme.com matches acme.com and every subdomain. A leading www. is ignored on both sides. Up to 50 entries.
Only browser traffic is checked. Events from the mobile SDKs and events sent with an API key are always accepted, since they have no page hostname of their own.
Bots
With Filter bots and crawlers on (the default, under Site settings → Exclusions), hits are dropped when the user agent looks like a crawler, a headless or automated browser (Puppeteer, Playwright, Selenium), a performance tool (Lighthouse, PageSpeed) or an uptime monitor, or a command-line client like curl. AI crawlers are filtered the same way. Visits *referred* by AI assistants such as ChatGPT, Perplexity or Claude are kept and grouped as the AI channel.
Localhost
Local traffic is filtered twice. The tracker sends nothing from localhost, 127.*, IPv6 literals like [::1], 0.0.* or file:// pages. And with Ignore localhost on (the default, under Site settings → Exclusions), the server drops web events from localhost, 127.*, 0.0.0.0, ::1 and hostnames ending in .localhost, .local, .test or .internal, from any script or web SDK.
To test on your machine, add data-allow-localhost to the script tag and turn Ignore localhost off, ideally on a separate test site so local visits don't mix with real ones.