> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crispstats.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> CrispStats is a hosted, privacy-first web analytics product. It has no self-hosted edition, no session replay, no heatmaps, no A/B testing, no mobile SDKs and no data import except a site's history from a Plausible export (Settings, Import and export).
> The script global is crispstats(...), site keys start with cs_pk_ and secret API keys start with cs_sk_. The script is served from https://in.crispstats.com/d.js and the REST API lives at https://crispstats.com/api/v1.
> There is no npm package to install. Integrations copy the script tag, the queue stub, crispstats.d.ts and proxy code from these docs or from Settings, Tracking code in the dashboard. A first-party proxy forwards one path of the site to https://in.crispstats.com/p/ and forwards only content-type, user-agent, accept-language, referer, origin, if-none-match and x-forwarded-for, never cookies.

# Exclude pages, hosts, IP addresses and your own visits

> Keep admin pages, staging copies, office IP addresses and your own browser out of CrispStats, with script attributes or with the exclusion settings on the collector.

To keep traffic out of CrispStats, either stop the script from sending it, with attributes on the script tag, or have the collector drop it, with the exclusion lists in **Settings**, **General**. Script attributes take effect when the new tag is deployed. Settings take effect for new events within about a minute of saving, without touching your site: the collector keeps a copy of each site's settings for up to 60 seconds. Neither removes events that were already counted.

| To exclude | In the script | In site settings |
| - | - | - |
| Pages, such as `/admin` | `data-exclude` | **Excluded paths** |
| Other hostnames, such as a staging copy | `data-domains` | **Domain** and **Additional hostnames** |
| An office or home network | | **Excluded IP addresses** |
| Your own browser | `localStorage.crispstats_ignore` | |
| Browsers that send Do Not Track | `data-dnt` | |

Changing site settings needs the owner or admin role on the site.

## Exclude pages

### With data-exclude

List the paths in `data-exclude`, separated by commas or spaces:

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<script
  defer
  data-site="cs_pk_xxxxxxxx"
  data-domains="example.com"
  data-exclude="/admin, /admin/*, /preview, /account/*"
  src="https://in.crispstats.com/d.js"
></script>
```

* `*` matches anything, including slashes: `/admin/*` covers `/admin/users` and `/admin/users/42`. It does not cover `/admin` itself, so list `/admin` as well if that page exists.
* `*` is not limited to a segment, so `/admin*` covers `/admin` and `/admin/users`, and also `/administrator` and `/admin-tools`. For a section and nothing else, list `/admin, /admin/*`.
* A pattern matches the whole path, so `/preview` does not cover `/preview-pricing`. A trailing slash is optional: `/preview` also covers `/preview/`.
* Only the path is compared, not the query string or the fragment.

Nothing is sent from an excluded page: no pageview, no engagement, no custom events. Its URL is also never used as the referrer of the next page. Excluding is all or nothing for a page: there is no way to keep its custom events while dropping its pageviews, and **Excluded paths** in settings drops every event from a matching page too. [Debug mode](https://docs.crispstats.com/tracking/localhost-and-testing.md#debug-mode) shows `excluded path` for each event the script holds back.

### With Excluded paths in settings

In **Settings**, **General**, **Excluded paths**, add a pattern and select **Add path**. The collector drops events from matching paths. A site can have up to 200 patterns, and each starts with `/`.

The collector reads patterns a little differently from the script:

| Pattern | Matches |
| - | - |
| `/pricing` | `/pricing` and `/pricing/` |
| `/blog/*` | `/blog/hello`, but not `/blog/2026/hello`. `*` stays within one path segment. |
| `/blog/**` | Every path under `/blog/`, at any depth. |

Patterns are compared with the stored path, without the query string or a hash route. Use settings when you cannot redeploy, or when the same rule should hold for every copy of the snippet.

## Exclude other hostnames

### With data-domains

`data-domains` makes the script send only on the hostnames you list, and their subdomains:

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<script
  defer
  data-site="cs_pk_xxxxxxxx"
  data-domains="example.com, shop.example.org"
  src="https://in.crispstats.com/d.js"
></script>
```

On `staging.example.net` or on a scraped copy of your site, the script then sends nothing. The snippet in **Settings**, **Tracking code** already has `data-domains` with your site's **Domain** and **Additional hostnames**.

### With Domain and Additional hostnames in settings

The collector only accepts events from the hostnames a site allows, whatever the script does:

* With no additional hostnames, the site's **Domain** and all its subdomains are counted.
* Once you add an entry under **Additional hostnames**, the collector counts the domain itself plus the exact hostnames you listed. Subdomains of the domain that are not listed stop counting, so add each one you want, such as `app.example.com` and `docs.example.com`.

`www.` and port numbers are ignored on both sides. A site can have up to 50 additional hostnames. Events from any other hostname are dropped, so a copy of your snippet on someone else's site does not reach your numbers.

## Exclude IP addresses

In **Settings**, **General**, **Excluded IP addresses**, enter an IPv4 or IPv6 address and select **Add address**. Visits from that address are dropped from then on. Use it for your office or home network.

Only a one-way SHA-256 hash of the address is stored. The list shows the first characters of each hash, not the address, so note which address you added if you will want to remove it later. A site can exclude up to 200 addresses.

The collector hashes the address exactly as it arrives on the request and compares the hashes, so two spellings of the same IPv6 address, such as `2001:db8::1` and `2001:0db8:0:0:0:0:0:1`, are different entries. Enter IPv6 addresses in their compressed lowercase form, such as `2001:db8::1`. Behind a [first-party proxy](https://docs.crispstats.com/tracking/proxy.md), the address compared is the first one in `X-Forwarded-For` when it is a public address. If your proxy does not forward the visitor's address, the collector sees your proxy's address instead.

## Exclude your own browser

To stop counting your own visits in one browser, open your site, open the browser's developer console and run:

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
localStorage.crispstats_ignore = 1;
```

The script then does nothing in this browser on this site. Local storage is kept per origin, so run it once on each hostname you visit, such as `example.com` and `app.example.com`. To count your visits again:

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
localStorage.removeItem("crispstats_ignore");
```

If the browser blocks local storage, the script cannot read the key and tracks as usual. To exclude every browser on a network instead, use [Excluded IP addresses](#exclude-ip-addresses).

## Respect Do Not Track

Add `data-dnt` to skip browsers that send the Do Not Track signal:

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<script defer data-site="cs_pk_xxxxxxxx" data-dnt src="https://in.crispstats.com/d.js"></script>
```

It is off by default, because the script collects no personal data either way. See [cookieless tracking](https://docs.crispstats.com/privacy/cookieless-tracking.md).

## Traffic dropped without any setting

Some traffic never counts, whatever you configure:

* The script does not run tracking in automated browsers that set `navigator.webdriver`, in Cypress, on local pages unless you add [`data-allow-localhost`](https://docs.crispstats.com/tracking/localhost-and-testing), or while a page is prerendering.
* The collector always drops AI crawlers (they are reported on [AI crawlers](https://docs.crispstats.com/ai/ai-crawlers.md) instead). At the **Standard** and **Strict** levels of **Bot filtering** in **Settings**, **General**, it also drops requests without a User-Agent and other bots. At **Off**, only AI crawlers are dropped. See [bot filtering](https://docs.crispstats.com/privacy/bot-filtering.md).

The collector answers every well-formed browser event with the same empty `202`, whether it was stored or dropped, so the network panel cannot tell you that an event was excluded.

## Next steps

> [card] [Test on localhost](https://docs.crispstats.com/tracking/localhost-and-testing.md)
>
> Send test events from a development build and confirm them.

> [card] [Bot filtering](https://docs.crispstats.com/privacy/bot-filtering.md)
>
> Choose how strictly automated traffic is kept out.

> [card] [Script attributes](https://docs.crispstats.com/tracking/script-attributes.md)
>
> Every option the script reads.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.