Skip to main content
A PHP proxy can forward the tracker and event requests through your own domain.
1

Create a proxy endpoint

Create a route for /script.js that fetches and returns the Trfyx script:
script-proxy.php
For events, forward the request body and relevant request headers to https://app.trfyx.com/api/events, then return Trfyx’s response to the browser.
Your event endpoint must forward the original visitor IP. Do not replace it with only the IP of your PHP server.
2

Update the tracker

index.html
3

Verify installation

Open Developer Tools → Network and confirm the script and event requests use your domain. Then verify a new visit in Trfyx.
For most PHP sites, Managed Proxy is simpler because it removes the proxy code and maintenance burden.

Next steps

Goals

Funnels

Managed Proxy

Troubleshooting

Last modified on October 12, 2026