-
Notifications
You must be signed in to change notification settings - Fork 599
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
Fix google analytics feature #989
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for toha-ci ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @joyao ! Thank you for the PR. Look like we are breaking compatibility here. With this change, following configuration will not work anymore:
services:
googleAnalytics:
ID: G-MEASUREMENT_ID
Do we want to force user to use analytics configuration from site.Params.analytics.services.google.id
? In that case, we should also provide a way do specify respectDoNotTrack
under site.Params.analytics.services.google
section.
I think both methods should be supported. I’ll fix it and thanks for your suggestion. |
Hi @hossainemruz, under the "{{ with .google }}" condition, my original changes support both project custom settings and original settings as following, and have been tested. analytics:
enabled: true
services:
# Google Analytics
google:
id: G-H4LBG7NDFZ
respectDoNotTrack: false services:
googleAnalytics:
ID: G-H4LBG7NDFZ
privacy:
googleAnalytics:
disable: false
respectDoNotTrack: true So I just add the "respectDoNotTrack" part. |
Issue
Fixes #955
Description
Fix google analytics feature based on official document.
https://gohugo.io/templates/embedded/#google-analytics
Test Evidence