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.
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.
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).