-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
How to set and update consent mode according to google official docs on CMP with react-ga4? #57
Comments
I started using the library recently and ran into the same roadblock I'm assuming these settings would go in the "gtagOptions" when initializing at least
Sadly fiddling with its "any" type doesn't sound very appealing to me So I've resorted to manually removing the cookies on consent denied by the user kinda like this article from dev.to says Would be awesome if this could be done directly with the library or is on the roadmap! |
@ReyasHey that example doesn't really accomplish the goal though, it's a very strict on or off. My understanding of the google consent policy is we can still use analytics even if the user denies access, it's just that google will not store cookies, and will strip out all the user identifying information. We really need a way to enable/disable this in react-ga4 without having to completely turn off analytics. |
I think we can use this before initialization:
and later
|
@PaloSP that worked, thanks for the info! |
Not a real issue but I am trying to figure out how to set and update google CMP (Consent Management Platform) with react-ga4.
According to the official google doc official google doc on consent mode this script:
will be added to the head and then the consent mode banner will have to update it with this:
How to achieve this just by using react-ga4?
The text was updated successfully, but these errors were encountered: