Source: https://usedataowl.com/docs/proxy-guide
Markdown source: https://usedataowl.com/docs/proxy-guide.md
Description: Recover visitors hidden by ad blockers: serve your analytics script from your own first-party domain so uBlock Origin and Brave don't block tracking.

# How to Proxy Web Analytics to Bypass Ad Blockers & Brave Shield

Ad blockers and privacy browsers block requests to known analytics domains, which hides a real share of visits, most of all on technical audiences. A first-party proxy serves the script and its endpoint from your own domain, under a path you pick, so there's nothing to block. It changes where requests go, not what's collected.

## How it works

Forward a few paths on your domain to DataOwl:

| Your domain | Forwards to |
| --- | --- |
| `/_ds/js/script.cookies.js` (or `/_ds/js/script.js`) | `https://usedataowl.com/js/script.cookies.js` |
| `/_ds/api/e` | `https://usedataowl.com/api/e` |
| `/_ds/api/p` | `https://usedataowl.com/api/p` (revenue attribution: payment links and `datasense("payment")`) |
| `/_ds/js/recorder.js` | `https://usedataowl.com/js/recorder.js` (session replay only) |
| `/_ds/api/replay` | `https://usedataowl.com/api/replay` (session replay only) |

Then load the script from your own path. It sends events next to wherever it was loaded from, so nothing else changes:

```html
<script
  defer
  data-website-id="YOUR_SITE_ID"
  src="/_ds/js/script.cookies.js"
></script>
```

Pick your own path instead of `/_ds`: filter lists can't guess a path only you use.

## Guides

- [Next.js](/docs/nextjs-proxy)
- [Vercel](/docs/vercel-proxy)
- [Netlify](/docs/netlify-proxy)
- [Cloudflare](/docs/cloudflare-proxy)
- [Nginx](/docs/nginx-proxy)
- [Managed proxy (custom subdomain)](/docs/managed-proxy)

## Visitor location behind a proxy

DataOwl locates visitors from their IP. Behind a proxy it would see your server's IP, so forward the visitor's:

| Header | Value |
| --- | --- |
| `X-DataOwl-IP` | The visitor's IP address |
| `X-DataOwl-Country` | Optional ISO country code, if your edge knows it |
| `X-DataOwl-Region` | Optional region name, percent-encoded |
| `X-DataOwl-City` | Optional city name, percent-encoded |

The Cloudflare and Nginx recipes set them. DataOwl also reads the geo headers Vercel, Cloudflare and CloudFront add.
