I create a Cookie Yes banner
When creating my banner on Cookie Yes, I need to activate Consent Mode V2 and add the cookies deposited by Google products in the right categories (here you can use the scan or add the cookies manually).
To activate Consent Mode V2, I go to Advanced Settings then in the Google Consent Mode section I activate Support GCM.
![Consent Mode V2 activation with Cookie Yes](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/enable_gcm.en_huc7b61401a295ce6b4c3894163246dff8_31450_1186x0_resize_q75_h2_box.webp)
Once cookies are set, this is what my banner looks like.
![Cookie Yes banner example](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/banner_example.en_huc7b61401a295ce6b4c3894163246dff8_205779_1686x0_resize_q75_h2_box.webp)
I add Cookie Yes banner to my website with Google Tag Manager
I import the CookieYes CMP tag available in the Google Tag Manager template gallery.
![Adding Cookie Yes CMP tag in Google Tag Manager](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/cmp_tag_import.en_hu0533df8c600b6ebf5e775c57536fef00_123433_1256x0_resize_q75_h2_box.webp)
I set up the Cookie Yes CMP tag
The CookieYes CMP tag asks for the Website Key.
This key is available in Advanced Settings then Get installation code.
![Getting the Website Key in CookieYes](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/website_key_location.en_huce8a8125372ac7b0a0629c2b84cbd960_160105_2028x0_resize_q75_h2_box.webp)
Then, I need to configure default consent.
![Default consent setup on the CookieYes CMP tag](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/default_consent_state.en_hu0533df8c600b6ebf5e775c57536fef00_67114_1786x0_resize_q75_h2_box.webp)
Next, I want this tag to be triggered as soon as possible so that consent is configured before any other tags are triggered.
So I choose the Consent Initialization - All Pages trigger.
![Cookie Yes CMP tag configuration](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/tag_configured.en_hu0533df8c600b6ebf5e775c57536fef00_145764_1826x0_resize_q75_h2_box.webp)
I save and will now move on to configuring Consent Mode V2.
Advanced mode with Google Tag Manager
In Advanced mode, you can configure your Google tag triggers as usual. You don’t need to do any additional configuration at this level.
Depending on the user’s interaction with the CookieYes banner, the consent signals will update and the Google tags will adapt their behavior.
Here’s what I’ve done on my container.
![GTM container with Consent Mode V2 advanced mode with Cookie Yes](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/advanced_mode_example.en_hu0533df8c600b6ebf5e775c57536fef00_91730_1768x0_resize_q75_h2_box.webp)
Basic mode with Google Tag Manager
In this mode, I’ll block Google tags if I don’t have the user’s consent.
To do this, I’m going to add an additional consent on all Google tags.
![Block tag if consent signal `analytics_storage` is `denied`](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/basic_mode_google_tag.en_hu1c16001ded50b9a6a830a8ad4aa3dccb_174532_1326x0_resize_q75_h2_box.webp)
analytics_storage
is denied
In this example, I’ve added the additional consent analytics_storage
as this is the Google tag that allows events to be sent to Google Analytics 4.
For Google Ads conversion tracking tags and the Conversion Linker, you can add the additional consent ad_storage
.
For tags that are triggered on page load
Basic mode requires knowing the last consent state before triggering the tag, which is why I’m going to trigger it on the cookie_consent_update
event sent by CookieYes in the Data Layer when consent has been updated.
I’ve also set the trigger to Once per page instead of Once per event. This prevents the tag from being triggered several times on a single page if the user updates his consent several times.
Here’s the configuration for a tag that triggers on page load.
![Setting up a Google tag that triggers on page load](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/basic_mode_tag_configuration_example_page_load.en_hu0533df8c600b6ebf5e775c57536fef00_144434_1468x0_resize_q75_h2_box.webp)
I will now test in Tag Assistant with this consent state at the time of consent update: b v
Consent signal | Consent state |
---|---|
analytics_storage | denied |
ad_storage | granted |
![Test that basic mode is correctly configured with the Tag Assistant](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/basic_mode_test.fr_huc7b61401a295ce6b4c3894163246dff8_133675_1532x0_resize_q75_h2_box.webp)
For tags that are triggered between two page loads
For these tags, it’s simpler: I can trigger them on the usual events.
I just need to add a condition to my trigger. In this condition, I’ll read the cookieyes-consent
cookie and check that consent has been given for this specific tag.
Here’s the configuration of a trigger for a tag that triggers between two page loads.
![Setting a trigger for a tag that is triggered between two page loads](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/basic_mode_trigger_example.en_hu0533df8c600b6ebf5e775c57536fef00_45206_1064x0_resize_q75_h2_box.webp)
Here’s what my container looks like after configuring basic mode.
![Container with Consent Mode V2 in basic mode with Cookie Yes](https://data-marketing-school.com/images/blog/consent-mode/cookie-yes/basic_mode_example.en_hu0533df8c600b6ebf5e775c57536fef00_118191_1794x0_resize_q75_h2_box.webp)
Check that Consent Mode V2 is working properly
With Tag Assistant
Tag Assistant lets me check whether the consent status has been updated, but it doesn’t let me know whether Google tags have taken this consent status into account for Advanced mode.
For Basic mode, Tag Assistant is much more useful, as I can see whether the consent state has been updated when the Google tags are triggered.
With an extension
The extension Consent Mode Inspector allows you to check that Consent Mode V2 has been correctly implemented.
Consent state | Consent history |
---|---|
![]() | ![]() |
With browser console
![Check consent mode v2 configuration in the console's Network tab](https://data-marketing-school.com/images/blog/consent-mode/axeptio/network_tab_check.fr_huce8a8125372ac7b0a0629c2b84cbd960_113415_1542x0_resize_q75_h2_box.webp)
Didn't find what you were looking for?
Get help from the Data Marketing Club