Skip to main content
By default, the Thrad Tag sends measurement requests to events.thrad.ai. Some browsers and content blockers limit third-party requests, which can leave gaps in attribution. A first-party proxy gives the Tag a path on your domain instead. Your server receives the request and forwards it to Thrad.
This is optional. Your current Tag install will keep working if you don’t set up a proxy.

Add a forwarding rule

We recommend /thr/. You can use /th/ if you need a shorter path. Avoid obvious advertising or vendor names such as /thrad/, /ads/, or /tracking/. Those are more likely to be included in blocker rules. Your proxy should forward these five routes to the matching path under https://events.thrad.ai/v1/: Choose your platform:
Install http-proxy-middleware:
Register the proxy before authentication, CSRF protection, and body-parsing middleware:
If your app is behind a load balancer, use the client IP and protocol values from that trusted platform rather than accepting incoming X-Forwarded-* headers.
Create app/thr/[...path]/route.ts. If your app uses a src directory, create it under src/app instead.
Deploy this route and the Tag configuration below together. No extra package is required.
Create a Module Worker and attach it to example.com/thr/* for your zone:
Your hostname needs a proxied Cloudflare DNS record. If you use /th/, update both the Worker route and the slice() prefix.
Add the map and upstream inside the http block in nginx.conf:
Then add this location to your site’s server block:
Check and reload the configuration with nginx -t and your usual reload command.
Add the reusable proxy and route handlers to your Caddyfile:
Check the file with caddy validate --config /etc/caddy/Caddyfile, then reload Caddy.
Enable mod_proxy, mod_proxy_http, mod_ssl, mod_headers, and mod_allowmethods. Then add these rules inside your HTTPS VirtualHost:
Check the configuration with apachectl configtest, then reload Apache.
Keep the upstream fixed to events.thrad.ai and only forward the five routes above. The examples also strip browser cookies and authorization headers, remove upstream Set-Cookie, and reject unknown paths so the route can’t become an open proxy.

Configure the Tag

Add THRAD_TAG_CONFIG before the main Tag script:
If you chose /th/, use that same path in both the forwarding rule and proxyEndpoint. Your existing tag ID, events, conversions, consent setup, and attribution behavior stay the same. The only change is where eligible browser requests are sent.

Verify it’s working

  1. Load a page with the Tag installed.
  2. Open DevTools → Network.
  3. Look for requests to your domain at /thr/config/... and /thr/collect.
The config request should return 200; collect should return 204. If the requests are hitting your domain, you’re all set. You may still see impression link or resolve requests go directly to events.thrad.ai. That’s expected—the impression cookie belongs to that host and can’t be read through your domain. If you get a 404, make sure the path in proxyEndpoint matches your forwarding rule. For 401 or 403, register the proxy before authentication and CSRF middleware. For 502 or TLS errors, confirm the upstream host is events.thrad.ai.