mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 06:17:45 +00:00
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:
1 parent
9218ab9937
commit
1cc265d99f
1 file changed
+6
-13
@@ -45,20 +45,13 @@ googleAnalytics = "G-MEASUREMENT_ID"
|
|||||||
|
|
||||||
### Use the Google Analytics Template
|
### 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
|
||||||
{{ template "_internal/google_analytics.html" . }}
|
{{ 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
|
## Disqus
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user