Update the GA template usage section

Mostly to remove the async example (not relevant for GA4 which people should be using by now).

See https://github.com/gohugoio/hugo/issues/9987
This commit is contained in:
Bjørn Erik Pedersen 2022-09-20 10:22:53 +02:00 committed by GitHub
parent 9218ab9937
commit 1cc265d99f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,21 +45,14 @@ googleAnalytics = "G-MEASUREMENT_ID"
### Use the Google Analytics Template
You can then include the Google Analytics internal template:
You can then include the Google Analytics internal template in the `<head>` section of your template:
```
```go-html-template
{{ if hugo.IsProduction }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
```
```
{{ 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
Hugo also ships with an internal template for [Disqus comments][disqus], a popular commenting system for both static and dynamic websites. In order to effectively use Disqus, you will need to secure a Disqus "shortname" by [signing up for the free service][disqussignup].