From 2456799f6dcb4e405c4a99ed0541d198bf9169f2 Mon Sep 17 00:00:00 2001 From: vimux Date: Mon, 12 Apr 2021 11:40:22 -0400 Subject: [PATCH] Add support for Google Analytics v4 Hugo 0.82.0+ is required if you want to use Google Analytics v4 --- layouts/_default/baseof.html | 4 ++++ 1 file changed, 4 insertions(+) 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 @@ {{- end }} {{- if not .Site.IsServer }} + {{- if hasPrefix .Site.GoogleAnalytics "G-" }} + {{ template "_internal/google_analytics.html" . }} + {{- else }} {{ template "_internal/google_analytics_async.html" . }} + {{- end }} {{- end }}