Skip to content

Proxy Setup

Ad blockers and privacy tools often block requests to known analytics and tracking domains. By routing usertrax through your own domain (first-party proxy), tracking requests look like regular traffic on your site.

Choose your setup

Pick your environment — we'll link you straight to the right guide.

Recommended guide

You need to proxy two endpoints:

Path on your domainProxies toPurpose
/cvs.jshttps://usertrax.io/cvs.jsTracking script
/api/usertrax/eventshttps://api.usertrax.io/api/eventsSession and conversion events

We recommend /api/usertrax/events instead of /api/events to avoid conflicts with your own API routes. You can use any path — just set the same value in usertraxConfig.endpoint. Some filter lists block paths containing “usertrax”; to avoid that, use neutral paths such as /p/c.js and /p/e.

After setting up the proxy, load the script from your domain and point events to your proxied endpoint:

<script>
window.usertraxConfig = {
endpoint: "/api/usertrax/events",
};
</script>
<script src="/cvs.js" data-key="YOUR_API_KEY" defer></script>

Keep data-key unchanged. The proxy must forward the X-Auth-Key header to api.usertrax.io.

Behind a proxy, every event comes from your server’s IP. To have usertrax store the real visitor IP (needed, among others, for matching in the Meta Conversions API and for rate limiting), the proxy sets the X-Usertrax-Client-Ip header to the visitor’s IP. usertrax only accepts it together with a valid X-Auth-Key.

If your site runs behind a CDN or load balancer, $remote_addr or request.ip is that hop’s IP. Use the CDN’s header instead, e.g. CF-Connecting-IP on Cloudflare, or configure your framework’s trusted proxies.

  1. Visit your live website
  2. Open the browser Network tab
  3. Confirm cvs.js loads from your domain (not usertrax.io)
  4. Confirm POST requests go to /api/usertrax/events on your domain
  5. Check the usertrax dashboard for new sessions and conversions

Your proxy is not forwarding the X-Auth-Key header. Ensure the header is passed through to api.usertrax.io.

  • Avoid obvious paths like /tracking/ or /analytics/
  • Use neutral paths such as /cvs.js and /api/usertrax/events
  • If you use a Content Security Policy, allow script-src and connect-src for your own domain

Check that usertraxConfig.endpoint matches your proxied events path exactly (including leading slash).