Hugo Umami Analytics Module

Umami is an open-source, privacy-focused web analytics tool that serves as an alternative to Google Analytics.

Modulegithub.com/hugomods/umami-analytics
StatsGitHub Stars Used By Used By Used By Used By

Installation

Import the Module

1module:
2  imports:
3  - path: github.com/hugomods/umami-analytics
1[module]
2  [[module.imports]]
3    path = 'github.com/hugomods/umami-analytics'
1{
2   "module": {
3      "imports": [
4         {
5            "path": "github.com/hugomods/umami-analytics"
6         }
7      ]
8   }
9}

Import the Template

1<head>
2  {{ partialCached "hugomods/umami-analytics/index" . .Params.analyze }}
3</head>

Site Configuration

params.services.umamni_analytics.id

NameContextTypeRequiredDefaultSinceExample
params.services.umamni_analytics.id-string---

Website ID.

params.services.umamni_analytics.script_url

NameContextTypeRequiredDefaultSinceExample
params.services.umamni_analytics.script_url-string-https://cloud.umami.is/script.js--

The JavaScript URL.

Site Configuration Example

hugo.yaml

1params:
2  services:
3    umami_analytics:
4      id: XXXXXXXX
5      script_url: https://cloud.umami.is/script.js

hugo.toml

1[params]
2  [params.services]
3    [params.services.umami_analytics]
4      id = 'XXXXXXXX'
5      script_url = 'https://cloud.umami.is/script.js'

hugo.json

 1{
 2   "params": {
 3      "services": {
 4         "umami_analytics": {
 5            "id": "XXXXXXXX",
 6            "script_url": "https://cloud.umami.is/script.js"
 7         }
 8      }
 9   }
10}

Page Parameters

analyze

NameContextTypeRequiredDefaultSinceExample
analyze-boolean-true--

Exclude pages from being tracked if false.