Skip to content

Google Consent Mode tags fired before consent mode defaults

This problem occurs when a Google tag is loaded before the Google Consent Mode default state is set. 

CookieTractor will automatically set the default state for Google Consent Mode, but for this to work, our script must be loaded synchronously (render-blocking) before any Google tags like Google Tag Manager, Google Analytics, etc.

If you use our script tag

  • Ensure that our script tag is placed as early as possible at the beginning of the <head> section.
  • Ensure that the async attribute has not been added to our script tag. This might introduce race conditions and other issues if our script cannot set the Consent Mode defaults before Google tags are loaded. To guarantee this, the script tag must be render-blocking. Using async on the script tag might introduce race condition issues with our YouTube and Vimeo replacement feature as well.

If you use Google Tag Manager

If you are using Google Tag Manager, we strongly recommend that you follow our installation guide and use our Tag Template. Our tag should be triggered with the trigger Consent Initialization - All Pages. The tag template will ensure that Google Consent Mode default state is set before any other tags are loaded.

Using a Custom HTML tag to load our script could result in race conditions.

If you use Google Tag Gateway

First verify whether the affected/late Google tag is enrolled in GTG. Some implementations of Google Tag Gateway (e.g. CDNs with one-click) will inject scripts into the HTML header element, this means that you loose control over the script loading order which could cause issues with late consent signals.

Consult our late consent signal troubleshooting guide for Google Tag Gateway for details.

Support

If you have questions about Google Consent Mode timing issues, feel free to contact us at google@cookietractor.com. Google does not provide direct support for the product – support should primarily go through us.