> ## 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.

# Count visitors who use ad blockers

> Why some ad blockers stop the CrispStats script, how to spot it, and how serving the script and collector from your own domain counts those visitors again.

Some ad blockers and privacy extensions stop requests to analytics hosts, so visitors who use them never reach your CrispStats numbers. To count them, serve the script and the event endpoint from your own domain with a first-party proxy: one forwarding rule on your host and a `data-api` attribute on the tag. This page explains what a blocker does, how to see it, and what changes when you proxy.

## What a blocker does

The standard tag loads the script from `https://in.crispstats.com/d.js` and sends events to `https://in.crispstats.com/e`. A blocker that lists analytics hosts can stop either request:

* **The script is blocked.** `d.js` never loads, so nothing is tracked on that page. `window.crispstats.v` is `undefined`.
* **The events are blocked.** The script runs, but its requests to `/e` fail, so the collector never sees the visit.

Either way, the visitor is missing from every report: visitors, pageviews, sources, events, goals and funnels. Server-side events and payments read from your payment provider do not go through the visitor's browser, so blockers do not affect them.

## Check whether a blocker affects you

Open your site in a browser with the blocker on, open the developer tools and reload with the **Network** panel open:

* A request to `d.js` or `/e` that fails, in Chrome with `net::ERR_BLOCKED_BY_CLIENT`, means the blocker stopped it.
* `window.crispstats && window.crispstats.v` returning `undefined` in the console means the script did not run.

Open the same page in a private window with extensions off. If the requests succeed there, the blocker is the cause. When you only want to confirm your install, testing without the extension is enough. To count visitors who keep their blocker on, set up the proxy.

## Serve CrispStats from your own domain

With a proxy, the browser loads the script and sends events to a path on your own site, such as `/k3x9qe/d.js` and `/k3x9qe/e`. Your server forwards everything under that path to `https://in.crispstats.com/p/`. Requests to your own domain look like any other request to your site, which is why a blocker that matches analytics hosts lets them through.

**1. Forward one path to the collector**

**Settings**, **Tracking code**, **Proxy through your own domain** proposes a path made for your site and shows the rule for Next.js, Next.js on Cloudflare, Vercel, Netlify, a Cloudflare Worker and nginx. The same code is in the [proxy guide](https://docs.crispstats.com/tracking/proxy.md#set-up-the-proxy). Each example forwards only the headers analytics needs and the visitor's address, never their cookies.

Use a path unique to your site rather than `/stats` or `/analytics`, which blockers can list as easily as a host.

**2. Point the tag at your path**

Replace the tag on every page. `src` loads the script from your domain and `data-api` sends events there too:

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

Keep any other attributes you use, such as `data-outbound`.

**3. Check it**

Open `https://example.com/k3x9qe/check?k=cs_pk_xxxxxxxx` and look for `"proxied": true` and `"visitorAddressForwarded": true`. Then, with the blocker on, reload your site and filter the network panel by your path: the script should load with `200` and the `POST` to `/k3x9qe/e` should get `202`. Your visit appears in **Realtime**.

## What changes behind a proxy

* **The visitor's address comes from your proxy.** The collector reads it from `x-forwarded-for` on proxy routes and uses it, as always, only to derive the daily visitor id. The examples set it for you. See [the visitor address](https://docs.crispstats.com/tracking/proxy.md#the-visitor-address).
* **Location comes from your proxy or the timezone.** Proxies on Vercel, Netlify and Cloudflare pass the visitor's country, region and city. Others give the country only, from the browser's timezone. See [location](https://docs.crispstats.com/tracking/proxy.md#location).
* **`crispstats.id()` works through the proxy**, and falls back to the collector directly when the proxy does not answer.
* **Rate limits count each visitor, not your server.** See [rate limits behind a proxy](https://docs.crispstats.com/tracking/proxy.md#rate-limits-behind-a-proxy).
* **Your Content Security Policy** can use `'self'` instead of `https://in.crispstats.com`. See [Content Security Policy](https://docs.crispstats.com/help/content-security-policy.md).

## Next steps

> [card] [Proxy setup](https://docs.crispstats.com/tracking/proxy.md)
>
> The rule for every host, the setup check and signing.

> [card] [Troubleshooting](https://docs.crispstats.com/help/troubleshooting.md)
>
> Work through other reasons a visit does not show up.

> [card] [Content Security Policy](https://docs.crispstats.com/help/content-security-policy.md)
>
> Allow the script and events, direct or through a proxy.


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