Ad-blocker bypass (proxy)

Route the beacon through your own domain so ad blockers treat it as a first-party request.

By routing analytics through your application's own domain, standard uBlock Origin heuristics treat the data endpoints as legitimate first-party resource calls and won't block the payloads.

Only the beacon (the data-host endpoint) needs proxying. That's what filter lists target. Add the rewrites below, then point each script's data-host at the proxied path. The neutral path names keep the request clear of collector heuristics, and the script files themselves load from our CDN as normal.

Next.js / Vercel

next.config.ts
module.exports = {
  async rewrites() {
    return [
      { source: '/api/jamp/event', destination: 'https://jamp.io/api/main' },
      { source: '/api/jamp/perf',  destination: 'https://jamp.io/api/app' },
      { source: '/api/jamp/diag',  destination: 'https://jamp.io/api/index' },
    ]
  },
}

Then point each script's data-host at the proxied route. The src stays on our domain:

index.html
<script defer data-website-id="YOUR_WEBSITE_ID" data-host="/api/jamp/event" src="https://jamp.io/main.js"></script>
<script defer data-website-id="YOUR_WEBSITE_ID" data-host="/api/jamp/perf"     src="https://jamp.io/app.js"></script>
<script defer data-website-id="YOUR_WEBSITE_ID" data-host="/api/jamp/diag"  src="https://jamp.io/index.js"></script>

Nginx

nginx.conf
location = /api/jamp/event { proxy_pass https://jamp.io/api/main;  proxy_set_header Host jamp.io; }
location = /api/jamp/perf  { proxy_pass https://jamp.io/api/app;   proxy_set_header Host jamp.io; }
location = /api/jamp/diag  { proxy_pass https://jamp.io/api/index; proxy_set_header Host jamp.io; }

Cloudflare Workers

worker.js
const ROUTES = {
  '/api/jamp/event': 'https://jamp.io/api/main',
  '/api/jamp/perf': 'https://jamp.io/api/app',
  '/api/jamp/diag': 'https://jamp.io/api/index',
}

export default {
  async fetch(request) {
    const url = new URL(request.url)
    const target = ROUTES[url.pathname]
    if (target) return fetch(target, request)
    return fetch(request)
  }
}