Proxy the tracking script
Avoid ad blockers by proxying the script and API through your own domain.
Why proxy?
Some ad blockers and privacy extensions block requests to known analytics domains, including attribu.tech. By serving the script and API from your own domain, requests look like first-party traffic and are not blocked.
Vercel / Next.js
Add these rewrites to your vercel.json (or next.config.js):
vercel.json
{
"rewrites": [
{
"source": "/js/attribu.js",
"destination": "https://attribu.tech/js/script.js"
},
{
"source": "/api/proxy/events",
"destination": "https://attribu.tech/api/events"
}
]
}next.config.js
module.exports = {
async rewrites() {
return [
{
source: "/js/attribu.js",
destination: "https://attribu.tech/js/script.js",
},
{
source: "/api/proxy/events",
destination: "https://attribu.tech/api/events",
},
];
},
};Generic reverse proxy
The concept works with any reverse proxy or CDN that supports URL rewrites. You need two rules:
| Your path | Proxies to |
|---|---|
/js/attribu.js | https://attribu.tech/js/script.js |
/api/proxy/events | https://attribu.tech/api/events |
For server-specific examples, see the Nginx guide and the Caddy guide.
Update your script tag
Point the script src to your proxied path and set data-api-url to your proxied API endpoint:
<script
defer
data-website-id="YOUR_SITE_ID"
data-domain="yourdomain.com"
data-api-url="https://yourdomain.com/api/proxy/events"
src="/js/attribu.js"
></script>The pixel auto-detects when it is served from a non-attribu.tech origin. If you omit
data-api-url, it falls back to window.location.origin + "/api/events", which works as long as your proxy handles that path.Verify installation
- Visit your site in an incognito/private window.
- Open your browser's Developer Tools and go to the Network tab.
- Confirm the script loads from
/js/attribu.json your domain (notattribu.tech). - Confirm the pageview POST goes to
/api/proxy/eventson your domain. - Check your attribu.tech dashboard. A new pageview should appear within a few seconds.