Vertigo Agency | Owl eyes on digital

Mastering Consent Mode v2 with Google Tag Manager & CookieYes6 min read

Flavia Groza-Bocăneț marketing specialist

FLAVIA BOCĂNEȚ Marketing Specialist & the owl

I launch my digital footprint into the world through meaningful collaborations. In exchange, I offer creativity, concentrated doses of digital education and punchlines for more than cheerful meetings.


In today’s privacy-conscious world, ensuring user consent for cookie collection is crucial. This article dives into Consent Mode v2, a framework that empowers website owners to manage user cookie consent seamlessly with Google Tag Manager (GTM). We’ll explore the benefits of Consent Mode v2 and its implementation steps using GTM and CookiesYes.

I uploaded a step-by-step YouTube video in the Romanian language. English subtitles are available.

Why Implement Consent Mode v2?

Suppose you use remarketing in Google Ads, target countries that have signed DMA: The European Digital Markets Act, or use Google Signals in Google Analytics 4. In this case, you need Consent Mode v2 implemented on your site. 

Of course, you can choose not to use Consent Mode v2 and continue to track users in GA4 to a certain extent, but you need to keep some things in mind. You can’t deliver personalized ads in Google Ads.


Consent Mode v2 offers several advantages:

  • Enhanced User Control: Users gain clear options regarding cookie usage, fostering trust and transparency.
  • Improved Compliance: Stay compliant with data privacy regulations like GDPR by obtaining informed consent.
  • Accurate Data Tracking: Ensure accurate data collection by respecting user consent preferences.
  • SEO Benefits: Search engines may favor websites that demonstrate responsible user data practices.DMA: The European Digital Markets 

Getting Started: Implementing Consent Mode v2 with GTM

Here’s a step-by-step guide to implementing Consent Mode v2 with GTM:

  • Choose a CMP (Consent Management Platform): Popular options include CookieYes, Cookiebot, or Iubenda. These platforms simplify cookie banner creation and consent management.
  • Integrate the CMP with GTM: Follow your chosen CMP’s instructions to connect it with your GTM container.
  • Enable Consent Overview in GTM: Navigate to “Container Settings” within GTM and activate “Consent Overview.” This feature provides valuable insights into consent statuses.
  • Create a Custom Consent Tag: Utilize GTM’s “Community Template Gallery” to find a template specific to your chosen CMP. Configure the tag with your CMP’s website key and preferred consent settings (Basic or Advanced).
  • Set Default Consent State: Define the default cookie behavior before user interaction (e.g., allow necessary cookies, block all others).
  • Configure Consent Triggers: Use triggers like “Consent Initialization” to ensure tags fire only after user consent is obtained. Define Additional Consent Requirements (Optional): For specific tags like Google Analytics 4 or advertising pixels, set additional consent requirements based on user preferences (e.g., require consent for “Analytics Storage” or “Ad Storage”).
  • Test Thoroughly: Utilize GTM’s “Preview and Debug” mode to verify that tags fire only with appropriate consent. Leverage browser developer tools to confirm cookie behavior matches your settings. Co

CookieYes Integration

CookieYes is the CMP I chose to create the cookie banner. I will not go through the configuration of the CookieYes account because these are some relatively simple steps. 

If you have used the CookieYes plugin for WordPress and would like to integrate it with Google Tag Manager, you cannot have both the plugin and GTM implementation running simultaneously. To proceed with the integration, you must first deactivate the CookieYes plugin and then follow the instructions provided within the Google Tag Manager platform.

After you create the CookieYes account, a site scan will occur. They will identify the cookies on the site and put them in some categories.

Firstly, in Advanced Settings, in the CookieYes platform, check Support Google Consent.

Google Consent Mode v2

In Google Tag Manager, navigate to the Admin tab, then go to Container Settings and enable Consent Overview. It’s crucial to do this for all Tag Manager accounts. 

enable consent overview tag manager

Subscribe to Marketing Newsroom, and you will receive the newsletter every Wednesday.

*Note: the newsletter uses Romanian language.

To define a new tag, we need to access the Community Template Gallery in the Tag Configuration section.

Most popular CMPs offer a Consent Mode v2 integration template, including CookieYes. To find CookieYes’s template, search for it in this area and add it to our Tag Manager interface.

Tags -> New -> Tag Configuration -> Community Template Gallery

CookieYes CMP tag manager

To configure the tag, a website key is required. To obtain the website key, navigate to the Advanced Settings tab in CookieYes. Once there, click on the ‘Get Installation Code’ button, and the website key can be found between the data and script.js. Copy the key and paste it into Tag Manager.

website key cookieyes consent mode v2

We need to define the default settings of Consent Mode on our site as the next step. Let’s talk about Google’s documentation for this. Consent Mode v2 has two implementation modes: Basic and Advanced.

1. In the Basic mode, if the user decides not to accept any cookies on your site, neither Google nor you will be able to track that user. They will be an invisible user on your site, and you will not be able to see them in the reports.

2. In the Advanced mode, Google recommends that you send a cookieless pin to them, even if the user has not accepted any cookies. This pin will indicate that a user was on your site. Google will only be able to model the data in GA4, but they are just as invisible.

The Basic Mode

To set the default state, you need to follow these steps:

1. Click on “Add Setting” and disable all cookies except for the necessary ones.
2. Ensure that the necessary cookies are correctly defined in the CookieYes categories.
3. Click on “Add” to save the new default state on your site.
4. In “Other Settings,” check both boxes.
5. Under “Triggering,” choose “Consent Initialization – All Pages” and click on “Save.”
6. Finally, submit and publish this new tag in your container.

cookieyes tag manager setup

Let’s create a new trigger to fire the existing tags. Go to Triggers -> New -> Trigger type: Custom event -> Event name: cookie_consent_update -> Save


To set up a Custom Event as a trigger for your tags, follow these steps:

1. Choose your desired tags, excluding the CookieYes tag.
2. Click on the two-circle icon located on the top right corner – Consent Overview.
3. Uncheck the previous triggering option, which is set to All Pages.
4. Click on the “+” button to add a new Custom Event.
5. Set the new Custom Event as a trigger for your selected tags.
6. Save your changes.
7. Finally, submit and publish your updated settings.

If you follow these steps, you should be able to successfully configure a Custom Event as a tag trigger.

cookieyes tag manager config

To manage the consent options for tags in your Workspace, follow these steps:

1. Click on the shield icon located at the top-right corner of the page – Consent overview. This will open a new window.

2. Here, you will see the consent options for each tag. CookieYes and GA4 have built-in consent.

3. For tags such as Google, Facebook, LinkedIn, and Hotjar, additional consents need to be set.

4. To set additional consent for Facebook and LinkedIn tags, select them and click on the shield icon from the top-right corner.

5. Next, enable the ad_storage consent option and click Save.

6. Similarly, to set additional consent for GA4 and Hotjar tags, select them and click on the shield icon from the top-right corner.

7. Enable the analytics_storage consent option and click Save.

8. Make sure to set this additional consent for all the tags, depending on their purpose.

facebook linkedin consent mode v2
google analytics 4 ga4 hotjar consent mode v2

The Advanced Mode

To enable the Advanced Mode, we need to make some changes. First, click on the shield icon from the top-right to access the Consent Overview. Next, select the Google tags you have – GA4, Google Ads, Conversion linker – and remove the Additional Consent. Set it to “Not set” and you’re all set!

consent mode v2 advanced

We need to remove the custom trigger we had set for all Google Tags since we do not have the user’s consent. Afterward, we will modify their trigger from Custom event to Consent Initialization – All Pages. Once done, click save and then Submit and Publish.

advanced consent mode v2

Here are the steps to implement Consent Mode v2, Basic, and Advanced Mode.

I recommend checking out a video that I recently posted on YouTube if you’re interested in learning how to properly test your implementation. The video provides comprehensive guidance on using Google Dev Tools to test your implementation effectively. You’ll learn how to leverage the various tools within Google Dev Tools to test for issues, check your code for errors, and ensure that your implementation is working as intended. This video is an excellent resource for anyone looking to optimize their implementation testing process, and I highly recommend giving it a watch.

Best Practices for SEO-Friendly Cookie Consent

  • Clear and Concise Banner: Design a user-friendly cookie banner that clearly explains the purpose of cookies and provides easy-to-understand consent options.
  • Multiple Consent Options: Offer granular control for users to choose which cookies they consent to (e.g., essential, analytics, advertising).
  • Respect User Choice: Strictly adhere to user consent preferences and avoid using workarounds to circumvent consent.
  • Data Minimization: Collect only the minimum data necessary for website functionality and user experience.
  • Transparent Privacy Policy: Maintain a readily accessible and up-to-date privacy policy detailing your data collection practices.


By implementing Consent Mode v2 with GTM, you empower users with control over their data while ensuring compliance and accurate data collection. Remember to prioritize a user-centric approach for optimal SEO and user trust. For advanced configurations or legal questions, consider consulting a privacy professional.

Additional Recommendations

The content focuses on implementation and doesn’t delve into the legal aspects of Consent Mode v2. It’s recommended to consult with a legal professional for legal compliance.


Thoughts? You can message me here.

Flavia Groza-Bocăneț

Sharing is caring!

Get notified on the next article