From e4f24755a892257c52d7b5351003a4524cfa7f07 Mon Sep 17 00:00:00 2001 From: Chen Xianmin Date: Mon, 17 Oct 2022 16:43:40 +0800 Subject: [PATCH] fix: support GA4 see: https://discourse.gohugo.io/t/how-to-make-site-updates-to-support-google-analytics-4/38271/4 --- dev-config.toml | 2 +- layouts/partials/head.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-config.toml b/dev-config.toml index 612d8819..ebf14f49 100644 --- a/dev-config.toml +++ b/dev-config.toml @@ -12,7 +12,7 @@ hasCJKLanguage = true # has chinese/japanese/korean ? # 自动检测是否 paginate = 5 # 首页每页显示的文章数 rssLimit = 20 # Limit Entry Count to Rss file # 限制 Rss 文章输出数量 disqusShortname = "xianmin12" # disqus_shortname -googleAnalytics = "UA-34199129-1" # UA-XXXXXXXX-X +googleAnalytics = "G-4SFSR6JRVT" # G-******** copyright = "" # default: author.name ↓ # 默认为下面配置的author.name ↓ enableGitInfo = true # use git commit log to generate lastmod record # 可根据 Git 中的提交生成最近更新记录。 # uglyURLs = true diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 41fc4625..2932b2fa 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -112,7 +112,7 @@ {{- if and (not .Site.IsServer) .Site.GoogleAnalytics -}} - {{ template "_internal/google_analytics_async.html" . }} + {{ template "_internal/google_analytics.html" . }} {{- end -}}