From 6f3809c58cf3b82faaf9a78cfb30aea96e3f63fb Mon Sep 17 00:00:00 2001 From: igor-baiborodine Date: Mon, 29 Jul 2024 15:34:45 -0400 Subject: [PATCH] feat: update config for Google Analytics --- v4/README.md | 10 ++++++++-- v4/exampleSite/hugo.toml | 7 ++++--- v4/tests/exampleSite/hugo.toml | 7 ++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/v4/README.md b/v4/README.md index 05b5f9e5..7d045d79 100644 --- a/v4/README.md +++ b/v4/README.md @@ -697,13 +697,19 @@ The second option is to use the `audio` shortcode within markdown content in a p Bilberry theme comes with built-in support for both v3 and v4 of [Google Analytics](https://analytics.google.com/analytics/web/). -You should set the value of the `googleAnalytics` property in the `hugo.toml` file to enable it. +To enable it, set the value of the `services.googleAnalytics.ID` property in the `hugo.toml`. + +```yaml +[services] + [services.googleAnalytics] + ID = 'G-XXXXXXXXXX' +``` Such value for Universal Analytics v3 is prefixed with the `UA` letters. So, suppose you migrate your existing website to the Bilberry theme, and your website is already tracked in Universal Analytics, given that the corresponding property was created before October 14, 2020. In that case, you should continue using the v3 value in the `hugo.toml` file. -However given that Universal Analytics will no longer process new data in standard properties beginning July 1, 2023, you +However, given that Universal Analytics will no longer process new data in standard properties beginning July 1, 2023, you will have to create a Google Analytics v4 property linked to your v3 property. If you created your property after October 14, 2020, you're likely using a Google Analytics v4 property already, and the diff --git a/v4/exampleSite/hugo.toml b/v4/exampleSite/hugo.toml index ce1b719f..83460d61 100644 --- a/v4/exampleSite/hugo.toml +++ b/v4/exampleSite/hugo.toml @@ -15,9 +15,6 @@ enableRobotsTXT = true # Change to one of your content languages defined at the end. DefaultContentLanguage = "en" -# Enable / Disable Google Analytics statistics for your site -googleAnalytics = "" - # Enable / Disable comments on the articles via Disqus. disqusShortname = "" @@ -162,6 +159,10 @@ disqusShortname = "" creditsText = "Bilberry Hugo Theme" creditsUrl = "https://github.com/Lednerb/bilberry-hugo-theme" +# Enable/Disable Google Analytics statistics for your site +[services] + [services.googleAnalytics] + ID = '' # customize your available languages for your multilingual site # or delete one of the [languages.xx] blocks to use the theme with only one supported language diff --git a/v4/tests/exampleSite/hugo.toml b/v4/tests/exampleSite/hugo.toml index d92f41d3..607c3625 100644 --- a/v4/tests/exampleSite/hugo.toml +++ b/v4/tests/exampleSite/hugo.toml @@ -11,9 +11,6 @@ enableRobotsTXT = true # Change to one of your content languages defined at the end. DefaultContentLanguage = "en" -# Enable / Disable Google Analytics statistics for your site -googleAnalytics = "" - # Enable / Disable comments on the articles via Disqus. disqusShortname = "bilberry-hugo-theme" @@ -138,6 +135,10 @@ disqusShortname = "bilberry-hugo-theme" creditsText = "Bilberry Hugo Theme" creditsUrl = "https://github.com/Lednerb/bilberry-hugo-theme" +# Enable/Disable Google Analytics statistics for your site +[services] + [services.googleAnalytics] + ID = '' # customize your available languages for your multilingual site # or delete the [languages] blog to use the theme with only one supported language