Proxy Datasense to get past ad blockers
Serve the Datasense script and endpoint from your own domain, so ad blockers and privacy browsers don't drop your visitors.
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 Datasense:
| Your domain | Forwards to |
|---|---|
/_ds/js/script.cookies.js (or /_ds/js/script.js) |
https://usedatasense.com/js/script.cookies.js |
/_ds/api/e |
https://usedatasense.com/api/e |
/_ds/api/p |
https://usedatasense.com/api/p (revenue attribution: payment links and datasense("payment")) |
/_ds/js/recorder.js |
https://usedatasense.com/js/recorder.js (session replay only) |
/_ds/api/replay |
https://usedatasense.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:
<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
Visitor location behind a proxy
Datasense locates visitors from their IP. Behind a proxy it would see your server's IP, so forward the visitor's:
| Header | Value |
|---|---|
X-Datasense-IP |
The visitor's IP address |
X-Datasense-Country |
Optional ISO country code, if your edge knows it |
X-Datasense-Region |
Optional region name, percent-encoded |
X-Datasense-City |
Optional city name, percent-encoded |
The Cloudflare and Nginx recipes set them. Datasense also reads the geo headers Vercel, Cloudflare and CloudFront add.