diff options
author | He Yeshuang <yeshuanghe@gmail.com> | 2021-08-04 05:52:59 +0300 |
---|---|---|
committer | He Yeshuang <yeshuanghe@gmail.com> | 2021-08-04 05:52:59 +0300 |
commit | 93dac05cfdc09212d9397c5a02927acc5ee8a2b5 (patch) | |
tree | e4f889ac64365349996ca282bd0ca9e9cb01e1dc | |
parent | 2cbf13a08f6986a3aa8a7772d732c1ce9d07eb01 (diff) |
Google Analytics v4
see https://gohugo.io/templates/internal/#use-the-google-analytics-template
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rwxr-xr-x | layouts/_default/baseof.html | 2 |
3 files changed, 3 insertions, 3 deletions
@@ -23,7 +23,7 @@ $ git submodule add https://github.com/heyeshuang/hugo-theme-tokiwa.git themes/h ```toml disqusShortname = "YOURSHORTNAME" -googleAnalytics = "UA-1234567890" +googleAnalytics = "UA-1234567890" # or "G-xxxxxxxx" in Google Analytics v4, in hugo v0.82+ [params] description = """ diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 1932f49..e047352 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -5,7 +5,7 @@ copyright = "Copyright © 2008–2019" disqusShortname = "YOURSHORTNAME" enableInlineShortcodes = true footnoteReturnLinkContents = "^" -googleAnalytics = "UA-FAKE" +googleAnalytics = "UA-FAKE" ## or "G-xxxxxxxx" in Google Analytics v4, in hugo v0.82+ hasCJKLanguage = true languageCode = "en" theme = "hugo-theme-tokiwa" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index f433748..cd857a0 100755 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -33,7 +33,7 @@ <link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ site.Title }}"> {{end}} {{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} - {{ template "_internal/google_analytics_async.html" . }} + {{ template "_internal/google_analytics.html" . }} {{ end }} {{ if or .Params.math .Site.Params.math }} {{ partial "math.html" . }} |