Documentation

Table of Contents

Google Consent Mode Troubleshooting Guide

Overview

Google Consent Mode is a critical component for websites using Google services to maintain compliance with privacy regulations like GDPR. When properly configured, it allows Google’s tags to adjust their behavior based on user consent choices. However, misconfigurations can lead to compliance issues and may affect your ability to use Google’s advertising and analytics services effectively.

This guide will help you identify and resolve common Google Consent Mode configuration issues detected by iubenda’s Site Scanner.

How to Check if Your Google Consent Mode is Properly Configured

The iubenda Site Scanner automatically checks your website for various Google Consent Mode configuration issues. If any problems are detected, you’ll see an “Attention Required” alert in your dashboard. The scanner checks for:

  • Correct script placement
  • Proper default consent settings
  • Multiple consent signals
  • Timing of consent updates
  • Privacy Controls and Cookie Solution configuration

Common Configuration Issues and Solutions

1. Google scripts fired before user consent is given

⚠️ Why this issue happens:

When the iubenda Privacy Controls and Cookie Solution script is embedded after Google scripts (like Google Analytics or Google Tag Manager), the Google scripts fire before users can make their consent choices. This can result in default consents being passed as “granted” without user consent, leading to GDPR non-compliance

💡 How to fix it

For WordPress sites:

Use the iubenda WordPress plugin, which automatically places the Privacy Controls and Cookie Solution script before any Google scripts.

For manual implementation:

Access your website’s HTML code
Locate the <head> section of your pages where scripts are embedded.

Identify the iubenda Privacy Controls and Cookie Solution script
Look for code similar to:

<script type="text/javascript" src="https://cs.iubenda.com/autoblocking/[YOUR-SITE-ID].js"></script>

Identify Google-related scripts
Look for scripts like:

  • gtag.js (Google Analytics)
  • googletagmanager.com (Google Tag Manager)

Reorder the scripts
Move the iubenda Privacy Controls and Cookie Solution script BEFORE any Google scripts.

Example of INCORRECT script order:

<!-- WRONG: Google Analytics script placed BEFORE Privacy Controls and Cookie Solution -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX');
</script>
<!-- iubenda Privacy Controls and Cookie Solution placed AFTER Google scripts -->
<script type="text/javascript">
var _iub = _iub || [];
_iub.csConfiguration = {
  "askConsentAtCookiePolicyUpdate":true,
  "cookiePolicyInOtherWindow":true,
  "countryDetection":true,
  "enableGdpr":true,
  "floatingPreferencesButtonDisplay":"bottom-right",
  "siteId":3258456,
  // ... rest of configuration
};
</script>
<script type="text/javascript" src="https://cs.iubenda.com/autoblocking/[YOUR-SITE-ID].js"></script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/gpp/stub.js"></script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script>

Example of CORRECT script order:

<!-- CORRECT: iubenda Privacy Controls and Cookie Solution placed FIRST -->
<script type="text/javascript">
var _iub = _iub || [];
_iub.csConfiguration = {
  "askConsentAtCookiePolicyUpdate":true,
  "cookiePolicyInOtherWindow":true,
  "countryDetection":true,
  "enableGdpr":true,
  "floatingPreferencesButtonDisplay":"bottom-right",
  "siteId":3258456,
  // ... rest of configuration
};
</script>
<script type="text/javascript" src="https://cs.iubenda.com/autoblocking/[YOUR-SITE-ID].js"></script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/gpp/stub.js"></script>
<script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script>
<!-- Google Analytics placed AFTER iubenda -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX');
</script>

2. Google Consent Mode is not correctly activated via code configuration

⚠️ Why this issue happens:

The Privacy Controls and Cookie Solution is intentionally configured via code with Google Consent Mode disabled, even though your website requires it for compliance with Google’s requirements and privacy regulations.

💡 How to fix it

  1. Update to the latest Privacy Controls and Cookie Solution script
    • Go to your iubenda dashboard
    • Copy the latest script version
    • Replace the old script on your website
  2. Ensure you’re using a supported script type:

With Autoblocking enabled

<script type="text/javascript" src="https://cs.iubenda.com/autoblocking/[YOUR-SITE-ID].js"></script>

With Sync.js (Autoblocking disabled)

<script type="text/javascript" src="https://cs.iubenda.com/sync/[YOUR-SITE-ID].js"></script>

Unified script (latest version)

<script type="text/javascript" src="//embeds.iubenda.com/widgets/[YOUR-WIDGET-ID].js"></script>
  1. Check your script configuration
    • Ensure "googleConsentMode": true is set in your configuration
    • Remove any instances of "googleConsentMode": false

3. Missing Autoblocking feature or Sync.js

⚠️ Why this issue happens:

Your Privacy Controls and Cookie Solution is installed but isn’t using either the autoblocking feature or Sync.js, which are required for Google Consent Mode to function properly.

💡 How to fix it

Update from outdated scripts: 

If you’re using an outdated version of the Privacy Controls and Cookie Solution script, replace it with one of these updated versions that support Google Consent Mode:

Option 1 – With Autoblocking (Recommended)

<script type="text/javascript" src="https://cs.iubenda.com/autoblocking/[YOUR-SITE-ID].js"></script>

Option 2 – With Sync.js

<script type="text/javascript" src="https://cs.iubenda.com/sync/[YOUR-SITE-ID].js"></script>

Option 3 – Unified script

<script type="text/javascript" src="//embeds.iubenda.com/widgets/[YOUR-WIDGET-ID].js"></script>

4. Consent purpose is granted by default before explicit user action

⚠️ Why this issue happens:

One or more consent purposes are set to “granted” by default before users make an explicit choice. This violates the principle of obtaining consent through explicit, positive action and doesn’t align with best practices.

💡 How to fix it

If using Google Tag Manager (GTM):

  1. Using iubenda’s GTM template
    • Open your GTM container
    • Find the “iubenda Privacy Controls and Cookie Solution” tag
    • Review the Consent Default settings
    • Change any value set to “Granted” to “Denied”
  2. Check for conflicting GTM templates
    • Ensure you’re not using another template that configures Google Consent Mode (e.g., Simo Ahava template)
    • Use only one consent management template

Check for third-party tools or plugins:

Plugins or external apps might be setting consent defaults incorrectly. This is especially common with tools that add pixels or configure Google services.

WordPress + Site Kit:

  • Google Site Kit plugin can manage Google Consent Mode
  • Since Consent Mode should be managed by iubenda’s CMP, disable any overlapping consent features in Site Kit

Shopify + Google & YouTube app:

Remove manual gtag consent code:

If you previously manually set consent defaults using gtag, remove that code. Look for and remove code like this:

<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// REMOVE THIS CODE - it overrides default consent
gtag('consent', 'default', {
  'ad_storage': 'granted',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied'
});
</script>

After removing this code, iubenda’s CMP will handle the default consent configuration, provided you have autoblocking or Sync.js enabled.

5. Multiple default consent signals sent due to conflict on the cookie banner

⚠️ Why this issue happens:

Multiple default consent signals are being sent because there are multiple cookie banners (from different CMPs) installed on the website. This can happen when using platforms like Shopify or when plugins are double-managing Google Consent Mode. When our solution and other plugins both launch Google Consent Mode signals, it causes incompatibility and multiple signals.

💡 How to fix it

1. Check for conflicting GTM templates

If you’re using the iubenda GTM template, ensure you’re not simultaneously using another template that configures Google Consent Mode (e.g., Simo Ahava template).

2. Identify and resolve third-party tool conflicts

Plugins or external apps might be setting consent defaults incorrectly. This is especially common with tools that add pixels or configure Google services.

WordPress + Site Kit:

  • The Google Site Kit plugin allows managing Google Consent Mode
  • Since Consent Mode is managed by iubenda’s CMP, disable any overlapping consent features from such plugins

Shopify + Google & YouTube app:

3. Remove manual setup in site code (gtag):

If you previously manually set consent defaults using gtag, remove that code as it will override the CMP configuration.

Example of code to remove:

<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// This code overrides default consent – REMOVE IT
gtag('consent', 'default', {
  'ad_storage': 'granted',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied'
});
</script>

After removing this code, iubenda’s CMP will be the sole handler of consent configuration.

How to debug multiple consent events:

To check your DataLayer for anomalies:

  1. Open your browser’s developer console
  2. Type dataLayer and press Enter
  3. Look for multiple consent events
  4. Check if certain purposes are not behaving as expected

6. Consent preference is updated before user made a choice on the cookie banner

⚠️ Why this issue happens:

A user’s consent preference (either Accept or Reject) is sent to Google before the user has explicitly made a choice on the banner. As a result, when the user eventually interacts with the cookie banner, their preference is no longer taken into account by Google, since a consent signal has already been sent earlier.

This often occurs when the Privacy Controls and Cookie Solution is configured with enableGdpr: false, meaning the user has unintentionally enabled US legislation and/or Swiss legislation even though the site should comply with GDPR legislation.

💡 How to fix it

1. Correct Privacy Controls and Cookie Solution configuration

  • Enable GDPR legislation if it’s disabled in the Privacy Controls and Cookie Solution configurator
  • Ensure enableGdpr: true is set in your configuration if your site serves EU users

2. Check for third-party interference

The same third-party tools mentioned in Issue #4 and 5 can cause this problem:

WordPress + Site Kit:

  • Google Site Kit plugin can manage Google Consent Mode
  • Disable any overlapping consent features since iubenda should handle all consent management

Shopify + Google & YouTube app:

Special Considerations for US Users

If you enable US Law in the Privacy Controls and Cookie Solution configurator, the default behavior for US users differs from GDPR:

  • Privacy Controls and Cookie Solution sets all Google Consent Mode purposes to ‘granted’ by default for US users
  • When users opt out of specific purposes under US Law, settings adjust accordingly

Note: If you’re on a Free plan, this applies only if you disable GDPR and apply only US Law. To apply GDPR for EU users and US Law for US users, you need at least an Advanced plan.

How US opt-out works:

ad_storage is granted when the user hasn’t opted out of:

  • Sale of personal information (purpose s)
  • Sharing of personal information (purpose sh)
  • Processing of personal information for targeted advertising (purpose adv)

analytics_storage is granted when the user hasn’t opted out of:

  • Sale of personal information (purpose s)

Debugging Google Consent Mode

To verify your configuration is working correctly:

  1. Use Google Tag Assistant
    • Install the browser extension
    • Navigate to your website
    • Check for Consent Mode events in the dataLayer
  2. Check the dataLayer
    Open your browser’s console and type “dataLayer”; look for consent-related events and verify they match user interactions.
  3. Monitor consent signals
    • Default consent should show all purposes as “denied” (for GDPR)
    • After user acceptance, relevant purposes should update to “granted”
    • Ensure only one set of consent signals is sent

Best Practices

  1. Always place iubenda scripts first – Before any Google or tracking scripts
  2. Use the latest script version – Check your dashboard regularly for updates
  3. Test after changes – Use the Site Scanner to verify your configuration
  4. One consent solution only – Avoid conflicts by using only iubenda for consent management
  5. Contact support when needed – These issues can be technical; our Support Team is here to help

Need Help?

If you’re experiencing difficulties resolving these issues:

  • Contact our Support Team for personalized assistance
  • Include your Site Scanner results in your support request
  • Provide details about your website platform (WordPress, Shopify, custom, etc.)

Remember, Google requires proper Consent Mode implementation for continued use of their advertising and analytics services. Ensuring correct configuration is essential for both compliance and maintaining your Google services functionality.