Movatterモバイル変換


[0]ホーム

URL:


Browse Hugo Analytics Modules

Hugo Google Analytics Module

HugoMods AuthorsMarch 29, 20231 min readModuleAnalyticsDocsGoogle Analytics

Google Analytics is a free Web analytics service that provides statistics and basic analytical tools for search engine optimization (SEO) and marketing purposes.

Donate

Become a backer or sponsor to support our work.

Sponsors
  • Support me on GitHub
Modulegithub.com/hugomods/google-analytics
StatsGitHub StarsUsed ByUsed ByUsed ByUsed By

Installation

Import the Module

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

Import the Template

Note

Please skip this step if your theme supportsHugoPress, such asHB Framework themes.

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

Site Configuration

services.googleAnalytics.ID

NameContextTypeRequiredDefaultSinceExample
services.googleAnalytics.ID-string---G-XXXXXXXX

The measurement ID.

Site Configuration Example

hugo.yaml

1services:2googleAnalytics:3ID:G-XXXXXXXXXX

hugo.toml

1[services]2[services.googleAnalytics]3ID='G-XXXXXXXXXX'

hugo.json

1{2"services":{3"googleAnalytics":{4"ID":"G-XXXXXXXXXX"5}6}7}

Page Parameters

analyze

NameContextTypeRequiredDefaultSinceExample
analyze-boolean-true--

Exclude pages from being tracked iffalse.


[8]ページ先頭

©2009-2025 Movatter.jp