Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Google Analytics V4 gtag #162

Merged
merged 1 commit into from
Mar 14, 2023
Merged

Conversation

selkhateeb
Copy link
Contributor

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.

Copy link
Owner

@StefMa StefMa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch 👍
Thank you for the contribution.

Can you please change the go.mod file? Then I can merge it 🙂 Thank you!

go.mod Outdated
@@ -1,4 +1,4 @@
module github.com/StefMa/hugo-fresh
module github.com/selkhateeb/hugo-fresh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be reverted 😇

Suggested change
module github.com/selkhateeb/hugo-fresh
module github.com/StefMa/hugo-fresh

@StefMa
Copy link
Owner

StefMa commented Mar 14, 2023

Maybe you can also adjust the exampleSite/hugo.yaml file comment for analytics to:

# Put in your tracking code without quotes like this: UA-XXX for universal tracking or G-XXX analytics v4 tracking

Would be nice I guess 🙃

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.
@selkhateeb
Copy link
Contributor Author

Thanks @StefMa for your work on this and providing it. I've updated the branch and removed my testing nonsense. Also added the G-XXX comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants