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:

1
2
3
4
5
<script
	defer
	src="https://cloud.umami.is/script.js"
	data-website-id="319540a5-488d-4338-ae16-1967ae274998"
></script>

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: Umami Dashboard

You should be done! Now if someone visits your Hugo site (without an ad-blocker), they should count as a visit.