Setting up a proxy using Nginx
Optimize tracking by proxying data via Nginx.
NGINX is a popular web server and reverse proxy. If you’re using NGINX to serve your website, we’ve prepared this guide to help you proxy the traffic through your own domain.
Setup
NGINX Configuration
Below you can see an example config for proxying the Vemetric Script and Hub. Please make sure to adjust the config according to your needs (like adding SSL certificates). At least you need to adjust the server_name
to your desired domain.
We recommend avoiding names or paths like
analytics.yourdomain.com
oryourdomain.com/track
, as this might also trigger ad/tracker blockers.Use more generic names like
hub.yourdomain.com
instead.
Configure Vemetric
Depending on your setup you need to adjust the Vemetric configuration:
HTML Script
The src
attribute of the script tag should now point to your proxy domain. You also need to pass the data-host
attribute with the value of your proxy domain.
NPM Package
For the NPM package you need to pass the host
option to the init
function with the value of your proxy domain.
Congratulations! You’ve successfully set up a proxy using NGINX. Please reach out if you have any questions.
Optimize tracking by proxying data via Vercel.
Optimize tracking by proxying data via Cloudflare.