Articles on: Scripts & cookies

Google Consent Mode


If you use any Google products on your website (Google Analytics, Google Advertising Products, etc.), enabling Google Consent Mode is an essential step to comply with data privacy regulations while still delivering personalized ads and user experiences. This feature allows websites and applications to adjust their tracking and advertising practices based on a user's cookie consent preferences set in the Clym widget, reducing the risk of unwanted data collection and privacy violations. By default, if you have blockingJS on your website already, then Google Consent Mode will be rolled out automatically. However, if you do not have this already on your website, you will need to follow the steps below to manually enable Google Consent Mode.


Once enabled, Google Consent mode interacts with the Clym widget to receive your website visitors' consent preferences and ensures that these preferences are preserved across the website pages they visit.


Using Google Tag Gateway (GTG)?

GTG deployments can affect consent signal timing and script execution order. See the Google Tag Gateway (GTG) and Late Consent Signals section below for important implementation guidance.


How does it work?


When a page loads before consent has been given, Clym sends a negative consent signal to Google by default for website visitors in the EU/UK.❌


If consent is given, Clym sends a positive consent signal to Google.✅


Enabling Google Consent Mode is an easy 3-step process:




First, copy the script below and inject it before Google Tag Manager on your website. Please note this is only required if you are using the Legacy script version without blocking.js.


window.dataLayer = window.dataLayer || [];

  if (!window.gtag) function gtag() { dataLayer.push(arguments); }

  gtag('consent', 'default', {

    'ad_user_data': 'denied',

    'ad_personalization': 'denied',

    'ad_storage': 'denied',

    'analytics_storage': 'denied',

    'wait_for_update': 500,

  });


2. Access services in the Clym Control Center


Please sign into your Clym Control Center account. From the left side menu, select Manage. Expand the Data privacy section and select Services.


Services section preview


In the top right corner, click + Add Service.


Add services button




You will need to repeat step 3 to create two individual services for Google Consent Mode Advertising and Google Consent Mode Analytics. In the window that opens, please fill out all of the required fields marked with an asterisk.


Add a service window


Under the Script tab, add each value below into the Javascript code field for the service you are creating.


Name: Google Consent Mode Advertising


gtag('consent', 'update', {

      ad_user_data: 'granted',

      ad_personalization: 'granted',

      ad_storage: 'granted',

    });


Name: Google Consent Mode Analytics


gtag('consent', 'update', {

      analytics_storage: 'granted'

    });


Script code field


If Clym has set up Google Consent Mode automatically, the two new services created for Google Consent Mode Advertising and Google Consent Mode Analytics will send positive signals to Google. You can also view your actual values using Google Tag Manager's preview functionality. Please review this knowledge base article to check if Google Consent Mode has been enabled properly.



Google Tag Gateway (GTG)


What is Google Tag Gateway?

Google Tag Gateway (GTG) routes Google tags through a first-party CDN or load balancer endpoint on your own domain, improving measurement resilience and data quality. GTG can be enabled via a one-click CDN injection in Google Tag Manager, but this convenience comes with a risk: when GTG is activated this way, you may lose control over the script load order on your page. If GTG initializes before your CMP's default consent signal is set, Google tags can fire before consent has been communicated, resulting in a late consent signal.

  

For full details, see Google's official Google Tag Gateway setup guide.


How to verify if a tag is enrolled in GTG

To check whether any of your tags are enrolled in Google Tag Gateway, follow Google's instructions on accessing your Google tag settings.


You can reach your Google tag settings from Google Tag Manager (Google tags tab → select the tag name),  Google Ads (Tools → Data Manager → Google tag → Admin), or Google Analytics (Admin → Data streams → Configure tag settings → Admin). Once there, check whether the Google tag gateway for advertisers option is configured.


A late consent signal occurs when one or more Google tags fire before your CMP's default consent state has been established. You can detect this in two ways:


Using Clym Debugger Mode

Append ?clym-debugger to your website URL in the browser (e.g. https://yoursite.com/?clym-debugger) and open the browser's Developer Tools Console. If you see:

  ▎ "Clym Debugger: Some Google tags might have fired before the default consent was set!"


To fix it, ensure the Clym script is placed above the Google Tag Manager script in your page's <head>.

 

Using the Clym Scanner

In your Clym Control Center, run a scan on your website. The scanner will flag any detected late consent signals and identify which scripts are loading out of order. Go to the Services page in Clym Control Center, hit the “Rescan” button and run a scan on any of your pages. Once the scan is complete and late consent is an issue on your site, it will show a warning.


If you identify a late consent signal and confirm that affected tags are enrolled in GTG, take one of the following actions:

  

Option 1 (Recommended): Enable Advanced Consent Mode (U+C) with Data Transmission Controls and Global Consent Defaults

Advanced Consent Mode — also called "U+C" (User and Consent) — is the recommended mechanism for GTG-enrolled tags because it is fully compatible with manual GTG setups. In this mode, Google tags execute immediately but operate in a cookieless/limited-data state until the user grants consent, allowing Google's modeling algorithms to produce measurement uplifts.


Steps to resolve late consent issues this way:

  1. Implement Advanced Consent Mode as described in the steps above (default state: denied; update on user consent).
  2. Enable Data Transmission Controls in your GTM settings to restrict what data is sent before consent is granted.
  3. Configure Global Consent Defaults in GTM according to the regions and compliance requirements applicable to your site.

 

Important: When Data Transmission Controls or Global Consent Defaults are configured, in any region where the Clym consent banner does not appear (for example, regions where consent is not legally required), the banner will automatically grant consent to maintain measurement continuity. This ensures analytics and advertising measurement are not disrupted for users in non-regulated regions.


Option 2: Migrate all tags into a GTM container and deploy GTM via GTG

Move all your tags into a single GTM container and deploy the GTM script itself through GTG. This gives you container-level control and ensures your consent default signal fires before any tags execute.


Option 3: Set up GTG manually

Instead of using the one-click CDN injection, configure GTG manually following Google's setup guide so that you control the script import order. This lets you guarantee the Clym default consent signal script (Step 1 above) loads before GTG and any Google tags initialize.



FAQ


What is the difference between Basic and Advanced implementation?


  • Basic implementation is when the Google scripts are blocked when the consent is denied. This way, Google will receive no data at all as the scripts won’t be executed on the website until consent is granted. This way, Google’s algorithms can not create an uplift based on an estimation. If you want to use Basic implementation, you need to make sure the Google tags are blocked before consent is granted. You can achieve this multiple ways, using our Clym Blocking Solution, Clym Tag Manager or Clym Google Tag Manager integration.
  • Advanced implementation is when the Google tags can execute, or fire, but by default, the consent state is set to a default (denied or granted based on user location and GEO rules). In advanced implementation, Google sends cookieless pings until consent is granted. This way, the uplift can be achieved. To implement the Advanced mode, the Google tags should not be blocked even if consent is denied. To have this, you can disable all the Google Consent Mode supported tags in the Clym Control Center.


How do I turn off the Google Consent Mode default signal completely?


If you have blocking.js implemented on your website, we will send the Google Consent Mode signals all the time. If you wish to remove this functionality, you can assign an attribute to the blocking.js script in your website. Adding “data-google-consent-mode=false” to the script will prevent signals from being sent.


How can I change which regions Google Consent Mode is implemented for?


By default, we don’t specify the region for the default signal, meaning it will send a denied signal, but if the user is coming from a region where consent is required or the user has expressed consent earlier, we will update it to be accepted before Google tags fire.


However, if you wish to change the default signal, you can do so by adding data attributes to the blocking.js:


  • data-google-consent-mode-default-denied-region=””
  • You can set the regions separated by comma, and Clym will send the denied signal based on the values.
  • Example: “data-google-consent-mode-default-denied-region=”MX,US-CA”


  • data-google-consent-mode-default-granted-region=””
  • Without specifying it, Clym does not send a granted default signal, but if you wish to use it, you can do so.
  • data-google-consent-mode-default-granted-region=”MX,US-CA”


Debugger mode


If you want to verify if Google Consent Mode and/or TCF has been implemented correctly, you can do so by adding this to the URL of your website in your browser: “?clym-debugger” for example: https://clym.io/?clym-debugger or https://clym.io/?someparameter=&clym_debugger


If it’s enabled in the Console of the Developer tools, you will see messages from the Clym Debugger. If the Google Consent Mode default consent signals were fired correctly, you can read this: “Clym Debugger: Google Consent Mode default fires before any Google tags.


If you see this: “Clym Debugger: Some Google tags might have fired before the default consent was set!” then some Google tags fire before the default consent signal was fired. To fix this, you must place the Clym script above the Google Tag Manager script on your website.


If you also use TCF and Clym executes too late, then you will see the message: “Clym Debugger: Google tag was fired before TCF could have been loaded!


To solve this problem, please ensure the Clym scripts are executed earlier by moving them to the top of the website.


If you encounter any challenges with implementing Google Consent Mode or any of the Google-related services with Clym, please reach out to our team at google-support@clym.io.

Updated on: 27/05/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!