diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 57687c0..abeda7a 100755 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -12,7 +12,7 @@ paginate = 2 # see https://gohugo.io/extras/pagination/ # post excerpt summaryLength = 10 # see https://gohugo.io/content-management/excerpts/ # google analytics -googleAnalytics = "UA-123456-78" # example: UA-123456-78, for more info, read the article https://support.google.com/analytics/answer/1008080?hl=en +googleAnalytics = "G-MEASUREMENT_ID" # see https://gohugo.io/templates/internal/#configure-google-analytics # disqus short name disqusShortname = "themefisher-template" # we use disqus to show comments in blog posts . To install disqus please follow this tutorial https://portfolio.peter-baumgartner.net/2017/09/10/how-to-install-disqus-on-hugo/ # disable language diff --git a/layouts/partials/essentials/head.html b/layouts/partials/essentials/head.html index 073cacc..1eb929a 100755 --- a/layouts/partials/essentials/head.html +++ b/layouts/partials/essentials/head.html @@ -30,7 +30,9 @@ -{{ template "_internal/google_analytics.html" . }} +{{ if and site.Config.Services.GoogleAnalytics.ID (ne site.Config.Services.GoogleAnalytics.ID "G-MEASUREMENT_ID") }} + {{ template "_internal/google_analytics.html" . }} +{{ end }}