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.
What gets proxied?
Section titled “What gets proxied?”You need to proxy two endpoints:
| Path on your domain | Proxies to | Purpose |
|---|---|---|
/cvs.js | https://usertrax.io/cvs.js | Tracking script |
/api/usertrax/events | https://api.usertrax.io/api/events | Session 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.
Update your script tag
Section titled “Update your script tag”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.
Forward the visitor IP
Section titled “Forward the visitor IP”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.
Verification
Section titled “Verification”- Visit your live website
- Open the browser Network tab
- Confirm
cvs.jsloads from your domain (notusertrax.io) - Confirm POST requests go to
/api/usertrax/eventson your domain - Check the usertrax dashboard for new sessions and conversions
Troubleshooting
Section titled “Troubleshooting”401 Unauthorized on event requests
Section titled “401 Unauthorized on event requests”Your proxy is not forwarding the X-Auth-Key header. Ensure the header is passed through to api.usertrax.io.
Events still blocked
Section titled “Events still blocked”- Avoid obvious paths like
/tracking/or/analytics/ - Use neutral paths such as
/cvs.jsand/api/usertrax/events - If you use a Content Security Policy, allow
script-srcandconnect-srcfor your own domain
Script loads but no conversions appear
Section titled “Script loads but no conversions appear”Check that usertraxConfig.endpoint matches your proxied events path exactly (including leading slash).