From 2736df1a57c003d9f7e46ac90a1ab05b5187ba3d Mon Sep 17 00:00:00 2001 From: Philippe Vinchon Date: Sun, 23 Feb 2020 23:14:53 +0000 Subject: [PATCH 1/2] Update baseof.html Don't publish analytics events during development Solution from https://discourse.gohugo.io/t/how-to-exclude-google-analytics-when-running-under-hugo-local-server/6092/34 --- layouts/_default/baseof.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 57ef293..f5fa96e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -74,6 +74,8 @@ {{- end}} - {{ template "_internal/google_analytics_async.html" . }} + {{ if not .Site.IsServer }} + {{ template "_internal/google_analytics_async.html" . }} + {{ end }} From 211f77c241337d36679d727aaf86a1f5f477a52a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 2 Apr 2021 11:00:43 +0200 Subject: [PATCH 2/2] Use _internal/google_analytics.html to support GA v4 Fixes #83 --- layouts/_default/baseof.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index f5fa96e..2bd9767 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -75,7 +75,7 @@ {{- end}} {{ if not .Site.IsServer }} - {{ template "_internal/google_analytics_async.html" . }} + {{ template "_internal/google_analytics.html" . }} {{ end }}