Option 1: Proxy the script at the server level
Proxying is the most reliable method. You configure your web server to forward requests for a path on your own domain to the Betterumami Cloud script URL. Ad blockers that blockcloud.betterumami.com will have no knowledge of your own domain and will pass the request through.
For example, a request to:
src attribute to point to your proxied path instead of the Betterumami Cloud URL.
Nginx
Add alocation block to your Nginx configuration:
Apache
UseProxyPass in your Apache configuration:
Express.js (Node.js)
Create a dedicated endpoint in your Express app that fetches and returns the script:Next.js
If you are using Next.js, use the built-in rewrites feature innext.config.js:
/stats.js in your HTML or <Script> component.
Option 2: Self-host the tracker script
If you do not have access to your web server configuration and cannot set up a proxy, you can download the tracker script and host it directly on your domain.1
Download the script
Open
https://cloud.umami.is/script.js in your browser and save the file to your computer.2
Upload to your domain
Upload the saved file to your website’s static assets directory, for example at
/assets/tracker.js.3
Update your tracking tag
Change the The
src attribute in your tracking script tag to point to your hosted copy:data-host-url attribute tells the locally-hosted script to send collected data back to Betterumami Cloud instead of trying to post to your own domain.Option 3: Rename the script and endpoint (self-hosted Betterumami only)
If you are running a self-hosted instance of Betterumami, you can use environment variables to rename both the tracker script file and the data collection endpoint, making them harder to fingerprint with generic blocklists.TRACKER_SCRIPT_NAME— renames the script file. For example, setting this toxmakes the tracker available athttps://your-umami.com/x.jsinstead of/script.js.COLLECT_API_ENDPOINT— renames the data collection endpoint. For example, setting this to/api/xroutes data through/api/xinstead of/api/send. The tracker script automatically uses whatever name you configure here.
src attribute to match the new script name after making these changes.
This option applies only to self-hosted Betterumami instances where you control the server environment. It is not available on Betterumami Cloud.