Proxy Mode

Privacy browsers like Brave block requests to known analytics domains. Proxy mode makes the Aizen script and event endpoint look like first-party traffic by routing requests through your own domain. The result is higher data accuracy with no changes to your backend.

Quick Setup

  • Add two rewrites that proxy /js/script.js and /api/event to https://aizenanalytics.com
  • Update your script tag to load from your own domain
  • Deploy the changes and verify new events appear in your dashboard
<script
  defer
  data-domain="YOUR_DOMAIN"
  data-website-id="YOUR_SITE_ID"
  src="https://YOUR_DOMAIN/js/script.js">
</script>

Framework Examples

Next.js

// next.config.js
module.exports = {
  async rewrites() {
    return [
      { source: '/js/script.js', destination: 'https://aizenanalytics.com/js/script.js' },
      { source: '/api/event', destination: 'https://aizenanalytics.com/api/event' },
    ]
  },
}

Vercel

// vercel.json
{
  "rewrites": [
    { "source": "/js/script.js", "destination": "https://aizenanalytics.com/js/script.js" },
    { "source": "/api/event", "destination": "https://aizenanalytics.com/api/event" }
  ]
}

Netlify

# netlify.toml
[[redirects]]
from = "/js/script.js"
to = "https://aizenanalytics.com/js/script.js"
status = 200

[[redirects]]
from = "/api/event"
to = "https://aizenanalytics.com/api/event"
status = 200

Cloudflare Pages

# _redirects (Cloudflare Pages)
/js/script.js https://aizenanalytics.com/js/script.js 200
/api/event https://aizenanalytics.com/api/event 200

Nginx

# Nginx
location = /js/script.js {
  proxy_pass https://aizenanalytics.com/js/script.js;
}

location = /api/event {
  proxy_pass https://aizenanalytics.com/api/event;
}

Notes

  • Your script and event endpoints must stay at /js/script.js and /api/event so the tracker can find them.
  • Keep the event endpoint un-cached. The script can be cached aggressively by your platform.
  • If you use a custom script host, update the rewrite destinations to match that domain.