-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
[Bug]: Compatibility with GA4 consent and services #652
Comments
Not sure I understand. How did you set up gtag? What does the plugin's cookie have to do with gtag? |
Yes, since the plugin doesn't come with any pre-configured service. The fact that you are actually getting some consent info means that you are actually loading the gtag script. Also, there is no relation between the plugin's own cookie (cc_cookie by default) and the ones gtag/ga4 reads, so I don't see how you're getting a list of the accepted categories in the first place. Here is an example setup of GTM with google consent mode v2. You might have to change a few things, based on your needs. For example, if you don't use google ads, simply delete the script with the |
Thank you for the quick answers to my problem. I managed to find the solution. For those of you in the same situation, I took the problem the other way round and looked at the GA4 settings. I changed the data search to a regular expression that only takes into account items inserted in categories Thanks for your help |
I think you could do something like this
|
Expected Behavior
You can choose between different categories, and only the categories you select will appear as granted in the Google Analytics consent mode.
Current Behavior
Even if you check only certain categories, they will all appear in the modes consent because this does not filter out the cookie.services section.
Steps to reproduce
Setup following CookieConsent, then configure Google Analytics with consent mod depending on cc_cookie
CookieConsent.run({
guiOptions: {
consentModal: {
layout: "box",
position: "bottom left",
equalWeightButtons: true,
flipButtons: true
},
preferencesModal: {
layout: "box",
position: "right",
equalWeightButtons: true,
flipButtons: false
}
},
categories: {
necessary: {
readOnly: true
},
analytics: {},
ads: {}
},
language: {
default: "fr",
autoDetect: "browser",
translations: {
fr: {
consentModal: {
description: "Chez Stores-et-rideaux.com, nous utilisons les cookies nécessaires pour faciliter votre navigation.",
acceptAllBtn: "ACCEPTER ET FERMER",
acceptNecessaryBtn: "Refuser",
showPreferencesBtn: "Personnaliser"
},
preferencesModal: {
title: "Choisir les cookies à accepter",
acceptAllBtn: "Tout Accepter",
acceptNecessaryBtn: "Refuser",
savePreferencesBtn: "Accepter et fermer",
closeIconLabel: "Close modal",
serviceCounterLabel: "Service|Services",
sections: [
{
title: "Essentiels",
linkedCategory: "necessary"
},
{
title: "Analytics",
linkedCategory: "analytics"
},
{
title: "Ads",
linkedCategory: "ads"
},
]
}
}
}
});
});
Proposed fix or additional info.
I finished by create a new cookie, to edit it myself and remove the services part. I think that google see the services part and use it too for gtag consent mod. When I remove manually the service part in cc_cookie it works fine (thats's why I'm able to reproduce it)
I've seen stories everywhere about services for categories, but nothing about the general service that encompasses all categories. I based myself on the github and the doc.
https://cookieconsent.orestbida.com/reference/api-reference.html
Version
3.0.0-rc.15
On which browser do you see the issue?
Chrome
The text was updated successfully, but these errors were encountered: