Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Atwood <daniel@atwood.io>2021-03-03 15:30:06 +0300
committerGitHub <noreply@github.com>2021-03-03 15:30:06 +0300
commitba16a14c6e884e309380610331aff78213f84751 (patch)
tree890cd7654e19c9326e44ba8793c1776f08113249 /docs/content/en/templates
parent782c79ae61a5ec30746ce3729933d6b4d31e0540 (diff)
Add support for Google Analytics v4
Diffstat (limited to 'docs/content/en/templates')
-rw-r--r--docs/content/en/templates/internal.md12
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/content/en/templates/internal.md b/docs/content/en/templates/internal.md
index e3d7e09c3..13d951aa1 100644
--- a/docs/content/en/templates/internal.md
+++ b/docs/content/en/templates/internal.md
@@ -27,14 +27,20 @@ While the following internal templates are called similar to partials, they do *
## Google Analytics
-Hugo ships with internal templates for Google Analytics tracking, including both synchronous and asynchronous tracking codes.
+Hugo ships with internal templates for Google Analytics tracking, including both synchronous and asynchronous tracking codes. As well as support for both v3 and v4 of Google Analytics.
### Configure Google Analytics
Provide your tracking id in your configuration file:
+**Google Analytics v3 (analytics.js)**
{{< code-toggle file="config" >}}
-googleAnalytics = "UA-123-45"
+googleAnalytics = "UA-PROPERTY_ID"
+{{</ code-toggle >}}
+
+**Google Analytics v4 (gtag.js)**
+{{< code-toggle file="config" >}}
+googleAnalytics = "G-MEASUREMENT_ID"
{{</ code-toggle >}}
### Use the Google Analytics Template
@@ -50,6 +56,8 @@ You can then include the Google Analytics internal template:
{{ template "_internal/google_analytics_async.html" . }}
```
+When using Google Analytics v4 use `_internal/google_analytics.html`.
+
A `.Site.GoogleAnalytics` variable is also exposed from the config.
## Disqus