Google Tag Manager Tip #4: A Tag read consent state before a default was set
‘A tag read consent state before a default was set’ notification appears in Google Tag Manager, but what does this notification really mean? What can you do to resolve this notification and how do you make sure your triggers on certain tags in Google Tag Manager are right. In this article we take a closer look at this.
What does this actually say?
This says that your triggers are set up so that some tags are fired even before a default permission state is set. This often happens when the tag is loaded before or at the same time as the permission banner, even though that banner is clearly visible to the visitor. As of 2024, Consent Mode applies to Google Analytics and Google Tag Manager. This means that Consent Mode is either accepted or rejected by the visitor. In any case, this should be clear. You arrange this by installing a proper permission banner and not working with a banner that does not have this technique. Otherwise, you will continue to see this message.
This problem also often occurs with permission banners where visitors can interact with the page before they have even made a choice. This leads to previously fired events and triggers before the default status or update status is known.
So how does Consent Mode work with Default and Update statements?
In this example, you can see that after a user reaches the website, all the consent mode variables are neatly set to ‘Denied’ except security_storage. That’s fine, too, because cookies set around website security, such as a WAF, can do no further harm. This consent state is also called the default consent state. Technically, this looks like this in the code:
gtag(‘consent’, ‘default’, {
‘ad_storage’: ‘denied’,
‘ad_user_data’: ‘denied’,
‘ad_personalization’: ‘denied’,
‘analytics_storage’: ‘denied’.
});
In this example, it is neatly passed to GTM and Google Analytics that in basic all settings are refused. After Consent is given by the visitors, a consent update state follows:
gtag(‘consent’, ‘update’, {
‘ad_user_data’: ‘granted’,
‘ad_personalization’: ‘granted’,
‘ad_storage’: ‘granted’,
‘analytics_storage’: ‘granted’.
});
Hey – you’ll also find these variables in your tags when you go to Additional Settings. Note Google Pixels already have these neatly built in. So these are external custom pixels.
‘A tag read consent state before a default was set’ appears
In the following example, you can see that this notification comes up in Google Tag Manager when you look at the consent level or the tag level. This is because the trigger for this aware tag was not set at the right time. Actually, this tag is “fired” before the “default” state is given and found.
If we then investigate why this is happening, we see that there is a tag that has “Additional consent settings” and thus is not waiting for the update.
Actually, outside of the Consent Platform Tag, it does not matter which tag it is, if only 1 is too early, the notification will already come up.
Therefore, make sure that the tag order of all other tags are not fired until after Consent Update. If you use a banner like Cookiebot, you can use the trigger ‘cookie_consent_update’. Should you find that too late, use 1 of the events that occurs after the “Consent Update,” such as “Initialization – All pages.
Most importantly, most importantly, do not put a tag in front of the consent update, except that of the Consent Management Platforms. That one should obviously be the first to be available.
The solution
In this particular case, a Custom HTML tag was fired too early, before the Consent State was updated. I nicely adjust the trigger of this tag to ‘cookie_consent_update’ or ‘initialization – all pages’ and the problem is solved.
Exception
In a few cases, there may be an exception, such as if you become fully employed with “Advanced Consent Mode. But actually, from an ethical standpoint, we advise against doing this with Advanced Consent Mode. Finally, you also want to respect the visitor’s consent settings, right?
What you can still do is at least ask the web developer to make on-site Event dataLayer pushes wait before the consent update state is available in the dataLayer. At least then you can be sure, that event tags are not fired too early.
Should you want to know more about working with Consent Mode in Google Analytics 4 and Google Tag Manager, or need help making this happen, or want to get started with Cookiebot? If so, please contact us.
Author: Paul Gudde
Function: Founder
Active since: 2007
Number of items: 25
Specializations: Google Analytics, Google Tag Manager, Google Ads, Google bigquery, Server Side Tagging
Let’s Make Things Happen
“Take the step to data enrichment today. Make the most of Google Analytics by leveraging our specialist knowledge.”
“Thanks to Paul’s implementation, we were finally able to get insight from Analytics to come up with actions. Paul clearly has experience in b2b marketing and puts us as a customer first in doing so”
Sales marketer WEX