<script> tag and paste it into your HTML.
Get your tracking code
1
Go to your website settings
Log in to Betterumami and click Websites in the left sidebar. Find the website you want to instrument and click the Edit button next to it.
2
Copy the tracking code
Scroll down to the Tracking code section. You will see a script tag that is pre-populated with your unique The
data-website-id. Click to copy the entire snippet.Your tracking code will look like this:data-website-id value is unique to your website and links collected events to your analytics property. Make sure you copy the full tag including that attribute.3
Paste the script into your site's head tag
Add the copied snippet to the
<head> section of every page you want to track. Place it in a shared layout or template file so it is included automatically across your entire site.Framework-specific instructions
Next.js
Next.js
In Next.js, use the built-in
next/script component instead of a plain <script> tag. This ensures the script is loaded correctly within Next.js’s rendering pipeline.Single-page applications (React, Vue, Svelte, etc.)
Single-page applications (React, Vue, Svelte, etc.)
Betterumami automatically detects client-side route changes in single-page applications. You do not need any additional configuration or calls to track navigation between pages. Simply install the script tag once in your root HTML template and all page transitions will be recorded automatically.
WordPress
WordPress
Paste the script tag into your theme’s
header.php file, just before the closing </head> tag. Alternatively, use a plugin such as Insert Headers and Footers to add the snippet without editing theme files directly.Verify the script is working
After deploying the script, visit your website in a browser. Return to the Betterumami dashboard — a pageview should appear in your real-time view within a few seconds. If you want to double-check at the network level, open browser developer tools (F12), go to the Network tab, reload the page, and look for a request to cloud.umami.is.
Troubleshooting
Ad blockers
Some ad blockers block analytics scripts regardless of whether they respect privacy. Traffic from visitors using those blockers will not appear in your dashboard. There are two ways to mitigate this:-
Proxy the script — Serve the script from your own domain so ad blockers that target the
cloud.umami.ishostname do not block it. For example, in Nginx you can proxyhttps://your-website.com/script.jstohttps://cloud.umami.is/script.js. With Next.js, you can use rewrites to achieve the same result without a server-level change. -
Self-host the script — Download the script from
https://cloud.umami.is/script.js, host it on your own domain, and set thedata-host-urlattribute to point back to the Betterumami cloud endpoint for data collection.
Data not appearing after installation
- Confirm the script tag is inside
<head>, not<body>or after</html>. - Check that the page you visited has been deployed — changes to a local development environment will not affect your live site.
- Make sure there are no JavaScript errors on the page that could be preventing the script from executing. Check the Console tab in browser developer tools for errors.