Skip to content

📊 Analytics: Support Umami Analytics - #228

Open
ToddE wants to merge 3 commits into
themefisher:mainfrom
ToddE:master
Open

ToddE wants to merge 3 commits into
themefisher:mainfrom
ToddE:master

Conversation

@ToddE

@ToddE ToddE commented May 28, 2025

Copy link
Copy Markdown

Support for Umami Analytics (https://umami.is)

Umami analytics can be used with Umami Cloud or by self hosting umami.
Hugo configuration supports default umami cloud or self-hosted url through setting params.toml variable

Update to head.html

<!-- Umami Analytics -->
{{ with site.Params.umami }}
{{ if .enable }}
{{ with .id }}
<script defer src="{{ site.Params.umami.url | default "https://cloud.umami.is/script.js" }}" data-website-id="{{ . }}"></script>  <!-- enables user to change script location if self-hosting -->
{{ end }}
{{ end }}
{{ end }}

Setting umami variables in params.toml

# umami analytics: see https://umami.is/
[umami]
enable = false # set to 'true' to enable umami
# url = "https://cloud.umami.is/script.js" # allows user to select a self-hosted location instead of umami cloud
id = "" # umami website ID

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant