Proxy Datasense with Netlify
Serve the Datasense script from your own domain with Netlify, so ad blockers don't block it.
Add this to netlify.toml. Replace /_ds with a path of your own.
netlify.toml
[[redirects]]
from = "/_ds/js/script.cookies.js"
to = "https://usedatasense.com/js/script.cookies.js"
status = 200
force = true
[[redirects]]
from = "/_ds/api/e"
to = "https://usedatasense.com/api/e"
status = 200
force = true
[[redirects]]
from = "/_ds/api/p"
to = "https://usedatasense.com/api/p"
status = 200
force = true
# Session replay, if you turn it on
[[redirects]]
from = "/_ds/js/recorder.js"
to = "https://usedatasense.com/js/recorder.js"
status = 200
force = true
[[redirects]]
from = "/_ds/api/replay"
to = "https://usedatasense.com/api/replay"
status = 200
force = trueThen load the script from your own domain:
html
<script
defer
data-website-id="YOUR_SITE_ID"
src="/_ds/js/script.cookies.js"
></script>Verify
Open your site with an ad blocker on. In the browser's network tab, /_ds/js/script.cookies.js and /_ds/api/e load from your own domain, and the visit shows up on the Realtime page.