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 pathProxies to
/js/attribu.jshttps://attribu.tech/js/script.js
/api/proxy/eventshttps://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

  1. Visit your site in an incognito/private window.
  2. Open your browser's Developer Tools and go to the Network tab.
  3. Confirm the script loads from /js/attribu.js on your domain (not attribu.tech).
  4. Confirm the pageview POST goes to /api/proxy/events on your domain.
  5. Check your attribu.tech dashboard. A new pageview should appear within a few seconds.

All proxy guides

Copied