Skip to main content

Integrating Google Consent Mode v2 on a Drupal Website

Last updated on December 14, 2024

This comprehensive guide provides step-by-step instructions on integrating Google Consent Mode v2 on your Drupal Website using CookieYes CMP template.

Note

To integrate GCM, a Drupal website with admin access is required.

Setup CookieYes Account

For New Users:

  1. Create a CookieYes Account:
    Create a CookieYes account using your HubSpot website’s URL.
  2. Customise Your Cookie Banner:
    • Select your Banner Language.
    • Choose a Layout and Colour that suits your website design.
    • Click Next Step to proceed.
  3. Choose Installation Method:
    On the setup screen, select Install with Google Tag Manager as your installation method.
installation method

You can customise the consent banner according to your website’s requirements.

For Existing Users:

  1. Log in to CookieYes:
    Log in to your CookieYes account using your existing credentials.
  2. Remove the CookieYes Script:
    Ensure you remove the existing CookieYes script from your website.
  3. Ensure Google Consent Mode is enabled.
    By default, the Basic Consent Mode feature is enabled. If you have previously disabled it, follow these steps to turn it back on:
    • Navigate to CookieYes Dashboard > Advanced Settings.
    • In Advanced Settings, toggle the button (to the right) labelled “Support GCM“ to enable the Basic Consent Mode.

Set up CookieYes GTM Template

1. Create a GTM account and set up a container.

create container

2. To add the CookieYes CMP template to your workspace,

  • In the container dashboard, Click Tags from the left sidebar, and then New as shown.

    Add new tag
  • Click on Tag Configuration > Discover more tag types in the Community Template Gallery and search for CookieYes CMP. Alternatively, you can get the template from this link.
  • Select the CookieYes CMP template and click Add to workspace Add to add it to your GTM installation.

    add to workspace
  • Insert the CookieYes website key, set other fields to appropriate values, and save the tag after naming it.

    tag conf

To get your Website Key, follow the below steps:

For New User:

  1. Head back to the CookieYes setup screen and locate the Website Key.
  2. Click the Copy key button to copy the Website Key to your clipboard.

    copy key
  3. In GTM, paste the copied key into this field labelled Website Keysite Key.

For Existing User

  1. Head back to the CookieYes account.
  2. Go to Advanced Settings and click Get Installation Code.

    Advanced Setting
  3. In the modal, click Install with Google Tag Manager > Copy code.

    Copy code from advance settings
  4. In the GTM account, paste the copied key into this field labelled Website Key.

3. To add Default Consent Setting:

  • Click Add Setting.
  • Select Enabled/Disabled from the drop down for each cookie category based on your requirements.
  • Set the Region by entering the region’s ISO-standardised (ISO 3166-2) codes for the specific regions you intend to Geo-target with your banner. However, if you prefer not to geo-target your banner to specific regions around the globe, simply enter All in the Regions field. Refer to the ISO 3166-2 standard for the appropriate region codes.
  • Click Add.
gcm

4. Select Consent Initialization – All Pages as the trigger for the tag.

trigger

5. Click Save to complete the integration of CookieYes with the Google Consent Mode.

6. Click Submit and Publish to Publish your Container version.

submit

Integrate GCM In Drupal

Note

This tutorial uses the following tag. Your configuration options may vary depending on the tag you use.

  1. In the Drupal Admin Dashboard, navigate to Extend from the top menu.

    extend
  2. Add an extension/module for Google Tag or Google Tag Manager. Alternatively, you can find an extension for Google Tag here.
  3. In the Filter field, search for the name of the extension you added. ex: Google Tag

    search
  4. Click on the added extension and and then select Configure.

    configure extension
  5. In the Google Tag ID field, enter your Google Tag ID/Container ID.

    enter tag id

    You can copy your Container ID from GTM Container Dashboard.

    copy container code
  6. Click Save to save your Google Tag Configurations.

    save

Verify GCM Integration

For both new and existing users, follow these steps to verify GCM integration on your website:

  1. If you are a new user, first verify the cookie banner installation:
    • Go to the CookieYes setup screen and click Verify.
    • You will see the message: “You have successfully implemented a cookie banner on your site!”

      Verify Implementation
  2. After verifying the banner or if you’re an existing user, proceed to verify GCM:
    • Go to Dashboard > Advanced Settings.
    • Scroll to the Google Consent Mode (GCM) section.
    • Click Check now next to Check GCM status to run the configuration check.

      Verify GCM

If the configuration is correct, you will see a success message stating, ‘No error detected’. If you encounter any error after running this check, refer to our GCM Troubleshooting Guide to resolve them and check again.

To further confirm the setup is correct, follow the steps in our Verification Documentation.

Setting Advanced Consent Mode in GCM

To set Advance Consent Mode, follow the below set:

  1. Navigate to CookieYes Dashboard > Advanced Settings.
  2. To set up Advanced Consent Mode in GCM, toggle the button (to the right) labelled “Allow Google tags to fire before consent”.

  3. Now, go back to your GTM account, click Submit, and thePublish to reflect the change on your website.

Enabling only the Support GCM option implements basic functionality, firing only allowed tags based on user consent. When you also activate Allow Google tags to fire before consent, it ensures Google tags fire even before the user consents to the banner, but they operate without setting cookies until the user provides consent. This balance allows for some data collection while respecting user privacy choices.

Help Guide

For detailed information on the Basic and Advanced Consent Mode v2 in CookieYes, refer to the Basic vs Advanced Consent Mode v2 documentation.

To further confirm the setup is correct, follow the steps in our Verification Documentation.

Conclusion

By following these steps, you will have integrated Google Consent Mode with your Drupal website using CookieYes CMP. You can complete your website scanning from the CookieYes Dashboard and explore further customizations and features.

For further assistance, our dedicated GCM support team are here to assist you.

Have more questions?

Reach out to us and we'll answer them.

Contact us