You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consent Update Command only allows "granted" or "denied". I am proposing you allow for undefined values.
Use case:
Default command may allow analytics tracking (North America)
Update command (initialization trigger) has to pass "granted" or "denied" based on the consent manager cookie being available.
This unknowing will over ride the default command on first pageview where consent manager cookie has not been set. Or requires additional GTM configuration to bypass the issue.
Above situation you would want to honor the default command and avoid updating.
Proposed code to fix issue:
`// Process updated consent state
if (data.command === 'update') {
var config_object={};
var categories=["ad_storage","analytics_storage","personalization_storage","functionality_storage","security_storage"];
var i;
for(i = 0; i < categories.length; i++){
if(data["update_"+categories[i]]!=undefined){
config_object[categories[i]]=data["update_"+categories[i]];
}
}
if (data.sendGtag) {
gtag('consent', 'update', config_object);
}
updateConsentState(config_object);
if (data.sendDataLayer) {
dlPush(false, data.update_ad_storage, data.update_analytics_storage, data.update_personalization_storage, data.update_functionality_storage, data.update_security_storage);
}
}`
The text was updated successfully, but these errors were encountered:
Consent Update Command only allows "granted" or "denied". I am proposing you allow for undefined values.
Use case:
Above situation you would want to honor the default command and avoid updating.
Proposed code to fix issue:
`// Process updated consent state
if (data.command === 'update') {
var config_object={};
var categories=["ad_storage","analytics_storage","personalization_storage","functionality_storage","security_storage"];
var i;
for(i = 0; i < categories.length; i++){
if(data["update_"+categories[i]]!=undefined){
config_object[categories[i]]=data["update_"+categories[i]];
}
}
if (data.sendGtag) {
gtag('consent', 'update', config_object);
}
updateConsentState(config_object);
if (data.sendDataLayer) {
dlPush(false, data.update_ad_storage, data.update_analytics_storage, data.update_personalization_storage, data.update_functionality_storage, data.update_security_storage);
}
}`
The text was updated successfully, but these errors were encountered: