diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 7149232..f8eabb9 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -168,4 +168,8 @@ dnt = false id = "e4f661ff-9a8c-49d4-b3cc-2efe553e3973" # Website ID datacache = false url = "https://eu.umami.is/script.js" -shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" \ No newline at end of file +shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" + +[params.GoogleAnalytics] +enabled = true +gtag = "G-TAGEXAMPLE" \ No newline at end of file diff --git a/layouts/partials/google_analytics.html b/layouts/partials/google_analytics.html new file mode 100644 index 0000000..9751923 --- /dev/null +++ b/layouts/partials/google_analytics.html @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ea2de2b..aabe2c7 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -103,8 +103,8 @@ --> -{{ if and (.Site.GoogleAnalytics) (hugo.IsProduction) }} - {{ template "_internal/google_analytics.html" . }} +{{ if (.Site.Params.GoogleAnalytics.enabled) }} + {{ partial "google_analytics.html" . }} {{ end }} {{ if (.Site.Params.UmamiAnalytics.enabled ) }}