Reverse Proxy
Set up a reverse proxy to route Universal Tag requests through your own domain so the browser treats tracking as first-party.
- Your site must be served over HTTPS. All proxy requests require a secure connection.
- You need access to modify your web server configuration files (Apache or NGINX).
- The default proxy path is /proxydirectory/ — contact your CIE if this conflicts with your existing URL structure.
- Restart your web server after applying any configuration changes before testing.
- Schedule a verification session with your CIE before deploying to production.
Why you should add a reverse proxy to your CJ Universal Tag
The reverse proxy intercepts tag requests from the browser and forwards them to CJ's tracking server — without the browser ever making a direct third-party request.
Implementation
Proxy Path Setup
Configure your reverse proxy to intercept requests at your proxy directory and forward them to CJ's tracking server.
Incoming PathForwarding TargetRequired HTTP Headers
Your proxy must pass the following five headers with every forwarded request. Missing or malformed headers will cause tracking to fail or attribution to be incorrect.
X-Forwarded-ForX-Forwarded-HostX-Forwarded-ServerX-Forwarded-Request-HostX-Forwarded-Request-PathServer Configuration
Apache
This configuration uses mod_proxy and mod_proxy_http. Confirm both modules are enabled on your server before applying.
# Required Modules
LoadModule ssl_module modules/mod_ssl.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
# SSL Proxy Support
SSLProxyEngine on
# Required Headers
RequestHeader add "X-Forwarded-Request-Path" "%{REQUEST_URI}s"
RequestHeader add "X-Forwarded-Request-Host" "%{HTTP_HOST}s"
# Proxy Forwarding
ProxyPass "/proxydirectory/" "https://www.mczbf.com/"
ProxyPassReverse "/proxydirectory/" "https://www.mczbf.com/"SSLProxyEngineProxyPassProxyPassReverseNGINX
This configuration uses NGINX's built-in proxy_pass directive. Replace YOUR_SERVER_HOST_NAME with your actual server hostname before deploying.
server {
server_name YOUR_SERVER_HOST_NAME;
location /proxydirectory/ {
proxy_ssl_server_name on;
proxy_pass https://www.mczbf.com/;
# Required Headers
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $server_name;
proxy_set_header X-Forwarded-Request-Host $host;
proxy_set_header X-Forwarded-Request-Path $request_uri;
}
}proxy_ssl_server_nameproxy_passNeed help?
Submit a support ticket for account-specific support.
Updated 11 days ago
