Hugo Microsoft Clarity Analytics Module

Microsoft Clarity Analytics is a free service that captures how people use your site.

Modulegithub.com/hugomods/microsoft-clarity
StatsGitHub Stars Used By Used By Used By Used By

Installation

Import the Module

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

Import the Template

1<head>
2  {{ partialCached "microsoft-clarity/index" . .Params.analyze }}
3</head>

Site Configuration

params.services.microsoft_clarity.id

NameContextTypeRequiredDefaultSinceExample
params.services.microsoft_clarity.id-string----

The measurement ID.

Site Configuration Example

hugo.yaml

1params:
2  services:
3    microsoft_clarity:
4      id: XXXXXXXXXX

hugo.toml

1[params]
2  [params.services]
3    [params.services.microsoft_clarity]
4      id = 'XXXXXXXXXX'

hugo.json

1{
2   "params": {
3      "services": {
4         "microsoft_clarity": {
5            "id": "XXXXXXXXXX"
6         }
7      }
8   }
9}

Page Parameters

analyze

NameContextTypeRequiredDefaultSinceExample
analyze-boolean-true--

Exclude pages from being tracked if false.