From fbd7eb76938e68e2fb14e65cf1160fef9e775519 Mon Sep 17 00:00:00 2001 From: weru Date: Fri, 17 Nov 2023 11:07:01 +0300 Subject: [PATCH] update google analytics --- exampleSite/config/_default/hugo.toml | 6 ++++-- layouts/partials/analytics/google.html | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/exampleSite/config/_default/hugo.toml b/exampleSite/config/_default/hugo.toml index 8c58f27..6207b14 100644 --- a/exampleSite/config/_default/hugo.toml +++ b/exampleSite/config/_default/hugo.toml @@ -4,7 +4,9 @@ languageCode = "en-us" paginate = 10 # Number of posts per page # this example loads the theme as hugo module # comment out line below, and uncomment the line after it if you prefer to load the theme normally -theme = ["github.com/onweru/browse"] +theme = "github.com/onweru/browse" # theme = "browse" # comment this out if you'ld rather use a fork of this repo or use it as a git submodule disqusShortname = "" # Enable comments by entering your Disqus shortname -googleAnalytics = "" # Enable Google Analytics by entering your tracking id +[services] + [services.googleAnalytics] + ID = "G-MEASUREMENT_ID" # Enable Google Analytics by entering your tracking id diff --git a/layouts/partials/analytics/google.html b/layouts/partials/analytics/google.html index 504fb57..e9317b2 100644 --- a/layouts/partials/analytics/google.html +++ b/layouts/partials/analytics/google.html @@ -1,5 +1,3 @@ -{{- if hasPrefix site.GoogleAnalytics "G-" }} +{{ if hugo.IsProduction }} {{ template "_internal/google_analytics.html" . }} -{{- else }} - {{ template "_internal/google_analytics_async.html" . }} -{{- end }} \ No newline at end of file +{{ end }} \ No newline at end of file