Hugo Microsoft Clarity Analytics 模塊

Microsoft Clarity Analytics 是一個免費的服務,其可以捕捉人們如何使用你的網站。

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

安裝

導入模塊

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}

導入模板

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

站點配置

params.services.microsoft_clarity.id

名稱上下文類型必填默認值版本示例
params.services.microsoft_clarity.id-string----

測量 ID。

站點配置示例

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}

頁面參數

analyze

名稱上下文類型必填默認值版本示例
analyze-boolean-true--

false 時,不追蹤當前頁。