Google Consent Mode lets your website tell Google tags whether visitors have consented to cookies and similar technologies. Google tags then adjust how they behave based on each visitor's choice. ComplyDog sends these consent signals to Google automatically, based on the choices visitors make in your ComplyDog cookie banner.
Whether and how you need to collect consent depends on your situation. Consent Mode is a way to pass your visitors' choices to Google. It is not designed to meet any particular legal requirement on its own.
For Google's full explanation, see:
- Google's Consent Mode overview: https://support.google.com/google-ads/answer/10000067
- Google's developer guide to Consent Mode: https://developers.google.com/tag-platform/security/guides/consent
- How Consent Mode works: https://developers.google.com/tag-platform/security/concepts/consent-mode
How ComplyDog maps consent to Google
Each cookie category in your ComplyDog banner controls one or more Google consent types:
| ComplyDog category | Google consent types |
|---|---|
| Strictly Necessary | security_storage (always granted) |
| Performance | analytics_storage |
| Targeting | ad_storage, ad_user_data, ad_personalization |
| Functional | functionality_storage, personalization_storage |
Before a visitor makes a choice, every consent type is set to denied, except security_storage. When the visitor clicks Allow All or Confirm My Choices, ComplyDog sends their choice to Google. Returning visitors' saved choices are sent automatically on every page load.
Step 1: Turn on Google Consent Mode
- In your ComplyDog dashboard, open Cookie Widget, then the Content tab.
- Under Integrations, turn on Enable Google Consent Mode v2.
Step 2: Install ComplyDog
Choose one of these two options. Don't use both on the same page.
Option A: Install code on your website
- In the dashboard, open Cookie Widget, then the Install tab.
- Copy the install code.
- Paste it at the very top of the
<head>of every page, above any Google tags (gtag.js, Google Analytics, Google Ads or the Google Tag Manager snippet).
The install code sets the consent defaults the moment the page starts loading, so it must come before your Google tags.
If you installed ComplyDog before turning on Consent Mode, copy the install code again and replace the old one on your website.
Option B: Google Tag Manager
- In Google Tag Manager, go to Tags, then New, then Tag Configuration.
- Choose Discover more tag types in the Community Template Gallery, search for ComplyDog, and add the template.
- Enter your ComplyDog campaign ID. You'll find it in the dashboard under Cookie Widget, then Install, in the install code (
campaignId). - Set the trigger to Consent Initialization - All Pages.
- Save and publish your container.
The template sets the consent defaults before any other tag in your container runs. You can also set different defaults for specific regions in the template's Regional overrides section.
Step 3: Choose basic or advanced Consent Mode
Google offers two ways to use Consent Mode. See Google's explanation: https://support.google.com/google-ads/answer/10000067
Advanced Consent Mode
Google tags load as soon as the page loads. While consent is denied, they send limited, cookieless signals to Google. Once a visitor consents, they work normally.
How to set it up: follow Steps 1 and 2 above. This is how ComplyDog works by default.
Basic Consent Mode
Google tags don't load at all until the visitor consents.
How to set it up with the install code (Option A):
Keep Steps 1 and 2 as they are, then change each Google tag on your website so ComplyDog holds it back until the visitor consents to the matching category:
- Change the script's
typetotext/plain. - Add
data-cookie-consentwith the category that should release it:performance,targetingorfunctional.
Example for Google Analytics, held back until the visitor consents to Performance:
<script type="text/plain" data-cookie-consent="performance" async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script type="text/plain" data-cookie-consent="performance">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXX');
</script>
Tag every part of each Google tag, as in the example above. Any part left untagged runs straight away.
Use performance for analytics tags such as Google Analytics, and targeting for advertising tags such as Google Ads.
How to set it up with Google Tag Manager (Option B):
Keep the ComplyDog template on Consent Initialization - All Pages. Then, for each Google tag in your container, open Advanced Settings, then Consent Settings, choose Require additional consent for tag to fire, and add the consent types it needs (for example analytics_storage for Google Analytics, or ad_storage for Google Ads). See Google's guide: https://support.google.com/tagmanager/answer/10718549
Switching between basic and advanced
- From basic to advanced: remove
type="text/plain"anddata-cookie-consentfrom your Google tags, or remove the extra consent requirements from your tags in Google Tag Manager. - From advanced to basic: follow the basic Consent Mode steps above.
- To stop sending Consent Mode signals entirely: turn off Enable Google Consent Mode v2 in the dashboard, then copy the install code again and replace the old one on your website. If you use the Google Tag Manager template, remove the ComplyDog tag from your container.
Step 4: Set up a banner that meets Google's requirements
Google asks that your banner:
- explains why data is collected,
- links to Google's privacy information at https://business.safety.google/privacy, inside the banner itself,
- gives visitors a clear way to consent.
ComplyDog includes recommended banner text that covers this:
- In the dashboard, open Cookie Widget, then the Content tab.
- With Google Consent Mode turned on, click Use recommended text under the Consent Mode toggle.
- Review the text, edit it if needed, and click Save changes.
The recommended text explains that data is collected to personalize content and ads and to analyze traffic, and links to Google's privacy page. The banner's Allow All button lets visitors consent.
You can change all banner text, buttons, categories and design in the dashboard without editing any code. Learn more about Google's requirements in the EU User Consent Policy: https://www.google.com/about/company/user-consent-policy/
Step 5: Test your setup
Open your website with ?cdog_debug=1 added to the address, for example https://yoursite.com/?cdog_debug=1. A ComplyDog debug panel shows whether the consent defaults are set before your Google tags load.
Learn more: https://support.complydog.com/support/kb/articles/496xv4mX/testing-google-consent-mode-with-debug-mode
You can also check your setup with Google Tag Assistant: https://tagassistant.google.com. See Google's guide to debugging Consent Mode: https://developers.google.com/tag-platform/security/guides/consent-debugging
Need help?
If Google tags aren't receiving consent signals, or something isn't working as expected, contact ComplyDog support first, not Google. We'll help you troubleshoot your Consent Mode setup and your banner.