fbpx

Implementing Google Consent Mode Using CookieYes

Last updated on December 2, 2021

CookieYes now supports Google Consent Mode. Consent Mode is an API developed by Google to integrate Google tag behavior and the user’s consent tool. The Consent Mode has five consent types for cookies, such as advertisement, analytics, functional, personalization and security, for using the global site tag or Google Tag Manager (GTM). You can use them to decide how the tags behave based on user consent. E.g. if a user denies consent to use analytics cookies, the website will not use the cookies and instead, send an aggregate level of analytics information. Thus, the Consent Mode bridges the gap between respecting user consent and measuring conversions.

Here is a guide to how to integrate CookieYes with the Consent Mode.

If you don’t have an account with CookieYes, sign up for free and get started.

CookieYes Consent Mode integration

If you use Consent Mode with CookieYes, every time the website users give their consent choice, CookieYes will signal Google to modify the tag behavior based on the user’s choice. Therefore, the website will stop collecting or using any personally identifiable information and use aggregated information for their services. 

There are two ways you can integrate Consent Mode with CookieYes — with and without using Google Tag Manager.

Implementation using Google Tag Manager template

First, you need to set up Google Tag Manager for your website. You can refer to the help guide for detailed instruction.

Now, follow along with these steps:

  1. Download the CookieYes template file from here.
  2. On the Tag Manager Console, go to Templates in the left sidebar and click on New as shown.
google tag manager new template for consent mode
  1. Click the three dots next to Save in the top right corner.Click Import and select the CookieYes template you just downloaded. Click Save to save the changes and create the template in Tag Manager.
Importing new template for consent mode
  1. To create a new tag, click Tags in the left sidebar, and then New as shown.
creating new tag
Searching for CookieYes consent mode template
  1. Insert the CookieYes website key and set other fields to appropriate values.
Inserting webiste key and other values for CookieYes consent mode  activation
To get the website key:
Log in to your CookieYes account and click the profile icon at the right top of the screen > Account Settings > Get Script > Copy Code.
Copy the website key from the src attribute (e.g. src=”https://cdn-cookieyes.com/client_data/YOUR_WEBSITE_KEY.js”).
  1. Select Consent Initialization – All Pages as the trigger for the tag and .
Trigger event in tag manager
Choosing trigger event for consent mode

Click Save after naming the tag to complete the integration of CookieYes with the Google Consent Mode.

CookieYes template for google consent mode integration

Implementation using custom script

To integrate CookieYes with Consent Mode without the use of GTM:

  1. Copy the custom script:

<script>

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

    function gtag() {

        dataLayer.push(arguments);

    }

    gtag(“consent”“default”, {

        ad_storage: “denied”,

        analytics_storage: “denied”,

        functionality_storage: “denied”,

        personalization_storage: “denied”,

        security_storage: granted,

        wait_for_update: 2000,

    });

    gtag(“set”“ads_data_redaction”true);

</script>

 

2. Paste the custom script above the CookieYes script and Google Tag Manager script. Ensure that the order of the scripts is as follows:

  • Custom Consent Mode script
  • gtag / GTM script
  • CookieYes script

The script must be loaded in this order for it to work.

CookieYes CMP maps all the five Google consent types into 4 categories: 

Google consent typeCookieYes consent typePurpose
ad_storageadvertisementTo enable advertisement cookies.
analytics_storageanalyticsTo enable analytics cookies.
functionality_storagefunctionalTo enable functional cookies for website functionality and settings.
personalization_storagefunctionalTo enable functional cookies for user personalization.
security_storagenecessaryTo enable necessary cookies for website security and protection, user UI preferences, etc. Such cookies do not require consent.

 

For more information about CookieYes, visit our website or contact support.

just a background image

We Will Gladly Help You

If you have any issues or queries regarding CookieYes implementation,
feel free to contact our support team.

just a background image