Skip to content

Commit

Permalink
Add Support for Google Analytics V4 gtag
Browse files Browse the repository at this point in the history
According to Hugo's documentation (https://gohugo.io/templates/internal/#use-the-google-analytics-template)

This template is not suitable for Google Analytics 4
{{ template "_internal/google_analytics_async.html" . }}

So, this change uses the recommended template that supports
both versions.
  • Loading branch information
selkhateeb committed Mar 14, 2023
1 parent 3c8b626 commit 9f1c711
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exampleSite/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module:
path: github.com/StefMa/hugo-fresh


googleAnalytics: # Put in your tracking code without quotes like this: UA-XXXXXX...
googleAnalytics: # Put in your tracking code without quotes like this: UA-XXX for universal tracking or G-XXX analytics v4 tracking
# Disables warnings
disableKinds:
- taxonomy
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/meta.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ template "_internal/google_analytics_async.html" . }}
{{ template "_internal/google_analytics.html" . }}
{{ if eq .Site.Params.openGraph true }}
{{ template "_internal/opengraph.html" . }}
{{ end }}
Expand Down

0 comments on commit 9f1c711

Please sign in to comment.