summaryrefslogtreecommitdiffstats
path: root/exampleSite/content/documentation
diff options
context:
space:
mode:
Diffstat (limited to 'exampleSite/content/documentation')
-rw-r--r--exampleSite/content/documentation/index.md76
1 files changed, 76 insertions, 0 deletions
diff --git a/exampleSite/content/documentation/index.md b/exampleSite/content/documentation/index.md
index 90f849c..351b153 100644
--- a/exampleSite/content/documentation/index.md
+++ b/exampleSite/content/documentation/index.md
@@ -482,6 +482,82 @@ This enhancement to the Ed theme allows you to leverage the power of community d
For more information on giscus, visit the {{< link src="https://giscus.app/" class="external" target="_blank" hreflang="en" rel="noopener noreferrer" >}}giscus website{{< /link >}}.
+## Integrating Analytics with Ed
+
+Ed provides seamless integration options to harness the power of Google Analytics and Google Tag Manager, ensuring you can monitor the performance and user engagement of your site effortlessly. To activate these services, a few configurations must be set up within your Hugo project’s configuration file. This section guides you through the process, highlighting the nuances and preferences within Ed’s theme.
+
+### Setting Up Google Analytics
+
+To enable Google Analytics, you first need to obtain your tracking ID from the Google Analytics dashboard. Once you have it, add the following to your configuration file:
+
+~~~ toml
+[services]
+ [services.googleAnalytics]
+ ID = 'G-MEASUREMENT_ID'
+~~~
+
+This snippet tells Hugo to include the Google Analytics tracking code in your site. However, merely providing the ID is not enough. You must also explicitly enable Google Analytics by modifying the privacy settings:
+
+~~~ toml
+[privacy]
+ [privacy.googleAnalytics]
+ disable = false
+~~~
+
+For a more privacy-conscious implementation, you can configure Ed to respect users' “Do Not Track” browser settings. This ensures that visitors who prefer not to be tracked are excluded from analytics data:
+
+~~~ toml
+[privacy]
+ [privacy.googleAnalytics]
+ disable = false
+ respectDoNotTrack = true
+~~~
+
+When `respectDoNotTrack` is set to `true`, Ed will honor the user's preference, making your site more respectful of user privacy choices.
+
+### Configuring Google Tag Manager
+
+If you prefer to use Google Tag Manager instead of Google Analytics, Ed has built-in support for it as well. Google Tag Manager offers more flexibility, allowing you to manage various tags — such as conversion tracking, remarketing, and more — through a single platform.
+
+To configure Google Tag Manager, add your container ID in the following format:
+
+~~~ toml
+[params]
+ [params.services]
+ [params.services.googleTagManager]
+ id = 'GTM-MEASUREMENT_ID'
+~~~
+
+As with Google Analytics, simply adding the ID does not enable tracking by itself. You must adjust the corresponding privacy settings to activate it:
+
+~~~ toml
+[params]
+ [params.privacy]
+ [params.privacy.googleTagManager]
+ disable = false
+ respectDoNotTrack = true
+~~~
+
+Here, setting `disable` to `false` activates Google Tag Manager, while the `respectDoNotTrack` option enables the same privacy-conscious behavior as described for Google Analytics.
+
+### Important Considerations
+
+- **Mutual Exclusivity of Services:** Ed only supports activating _either_ Google Analytics _or_ Google Tag Manager, but not both simultaneously. This is by design — Google Tag Manager, when enabled, forwards data to Google Analytics internally. Therefore, enabling both services would result in redundant tracking and could potentially skew your metrics.
+- **Configuration File Locations:** Note that the configuration structures differ slightly:
+ - Google Analytics settings reside under the root configuration sections.
+ - Google Tag Manager settings are nested within the `[params]` section of your configuration file.
+
+When both configurations are present, Ed prioritizes Google Tag Manager, bypassing the Google Analytics settings entirely. This makes your setup simpler and more robust, avoiding conflicting tracking scripts.
+
+### Making the Choice
+
+So, which should you choose? It depends on your needs:
+
+- **Google Analytics** is ideal for straightforward tracking and reporting without additional complexity.
+- **Google Tag Manager** is recommended if you need advanced tag management, custom events, or multiple analytics integrations.
+
+When you decide, set up the configurations accordingly and let Ed handle the rest.
+
---
## Getting help