-
Notifications
You must be signed in to change notification settings - Fork 70
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
Implement consent mode v0 #361
Conversation
Deny all for EEA visitors. Document the customization snippet.
to cover the quirks of wcgaiData not being loaded otherwise.
After #363 the |
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.
Hey @tomalec, thanks for adding the initial consent implementation.
All appears to be working well and the consent parameters are picked up by Google. One issue with the country code config but everything else looks good ✅
Co-authored-by: martynmjones <[email protected]>
Changes proposed in this Pull Request:
Add the minimalistic implementation to add support for Google Consent mode
We want to add MVP ASAP before Google starts penalizing merchants without this setup. (pcTzPl-25o-p2)
Later, we could iterate by adding settings to customize the snippet a bit using UI.
This PR adds a basic default and documents how to customize/extend it.
Checks:
Screenshots:
Detailed test instructions:
remove-universal-analytics
branch)/wp-admin/admin.php?page=wc-settings&tab=integration§ion=google_analytics
) so WooCommerce Core will not set up its owngtag
config making us do nothing.Check that the second Consent entry is added with custom defaults
Additional details:
This customization capabilities are not ideal, as the is a change to get
gtag
hit before the second consent config is saved, as we may trigger page_view or other events. We may improve that in the future.Especially since the current logic to force
main.js
to run after the document is ready is pretty hacky. (I guess that's why we add inline scripton
wp_footer` hook). I think we can make it in a cleaner fashion:DOMContentLoaded
event listenerChangelog entry