diff options
author | vimux <vimux@protonmail.com> | 2021-04-12 18:40:22 +0300 |
---|---|---|
committer | vimux <vimux@protonmail.com> | 2021-04-12 18:40:22 +0300 |
commit | 2456799f6dcb4e405c4a99ed0541d198bf9169f2 (patch) | |
tree | 0fb4c0f50f20371b10553b49c52ee146e5715faa | |
parent | ac6004e5ad5591f1083f8537a3d85ed29bc5ed52 (diff) |
Add support for Google Analytics v4
Hugo 0.82.0+ is required if you want to use Google Analytics v4
-rw-r--r-- | layouts/_default/baseof.html | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a95b19d..a1eec1a 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -37,7 +37,11 @@ <link rel="manifest" href="{{ "manifest.json" | relURL }}"> {{- end }} {{- if not .Site.IsServer }} + {{- if hasPrefix .Site.GoogleAnalytics "G-" }} + {{ template "_internal/google_analytics.html" . }} + {{- else }} {{ template "_internal/google_analytics_async.html" . }} + {{- end }} {{- end }} </head> <body class="body kind-{{ .Kind }}"> |