This post was written using this article from Pablo González.
Our goals
- Add Umami to our Hugo page
- Receive analytics from Umami Since there’s only 2 goals, this shouldn’t be too hard.
Adding umami to Hugo
On my Hugo pages, I am using the PaperMod theme. So if you are using a different theme, you might need to look somewhere else to have the same files.
In my project files, I went to themes/PaperMod/layouts/partials/head.html
, opened it, and added my tracking code to it, it should look something like this:
|
|
Replacing the data-website-id with your own website ID, or you won’t receive analytics.
Receiving analytics from Umami
Once you have done the above, you should be able to go back to umami, and have the following or similar in your dashboard:
You should be done! Now if someone visits your Hugo site (without an ad-blocker), they should count as a visit.