From 046f31434c5fcc983bde13217455cc81ec5f8fef Mon Sep 17 00:00:00 2001 From: Paul Maddern Date: Fri, 15 Mar 2024 18:48:15 +0000 Subject: [PATCH] Update 404.html Google Analytics async template is deprecated: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/google_analytics_async.html#L1 I've also wrapped it in an `if` statement so it doesn't track non-production environments. --- layouts/404.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layouts/404.html b/layouts/404.html index bc53fc4..00455e1 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -34,7 +34,10 @@ {{ partial "footer.html" . }} - {{ template "_internal/google_analytics_async.html" . }} + + {{ if eq (getenv "HUGO_ENV") "production"}} + {{ template "_internal/google_analytics.html" . }} + {{ end }}