Fixing Google errors 2.1a
Google as vendor of the TCF, must wait for the CMP to trigger ad request.
But until now, they don't wait for the user consent and throw ad request even if the user is still exposed to the CMP. This is how 2.1a errors come up.

Adsense

Just add this piece of code in your body
1
<script type="text/javascript">
2
(adsbygoogle=window.adsbygoogle||[]).pauseAdRequests=1;
3
__tcfapi('addEventListener', 2, function(tcData, success) {
4
if (success && tcData.gdprApplies && (tcData.eventStatus === 'tcloaded' || tcData.eventStatus === 'useractioncomplete') ) {
5
(adsbygoogle=window.adsbygoogle||[]).pauseAdRequests=0;
6
__tcfapi('removeEventListener', 2, () => {}, tcData.listenerId);
7
}
8
})
9
</script>
Copied!
1 - This script will ask Adsense to put on hold adrequest until the cmp collect the consent.
2- After user gave consent, ad requests are fired and ads are displayed.
You should see error 2.1a decreasing quickly. If it not the case, drop us an email to [email protected]
Google reports show errors aggregated on 7 days so you need to compare to the sum of Ad calls on the same period if you want to calculate a ratio.
Update on 2020-11-06 : Last clients that used this script have reported a drop of errors by 95% for Adsense.
Due to the way all advertising stack are built, it's virtually impossible to get a "zero" errors for the 2.1a errors .
Here is some organic cause of errors :
Adblockers
Slow internet bandwidth
Beta version of browsers
...
Last modified 7mo ago
Export as PDF
Copy link
Contents
Adsense