Integrating Google Consent Mode v2 on Shopify website using CookieYes GTM Template

Last updated on January 20, 2026

Google Consent Mode v2 enhances user privacy by ensuring that Google’s advertising cookies and associated vendor cookies are not read or written until the user consents. This is a complete guide providing step-by-step instructions on integrating Google Consent Mode v2 for your Shopify store.

Step 1: Install CookieYes

To get started with CookieYes, create a new account or log in to your existing one.

For New Users

  1. Sign up for a CookieYes account
    Once you complete the sign-up process, you’ll be guided through the initial setup process.
  2. Configure the consent banner
    On the setup screen:
    • Select the Banner Language for your cookie consent banner.
    • Choose your preferred Banner Layout and Colour from the available options.
    • Click Next step to continue.
      Setup Screen
  3. Choose the installation method
    On the installation screen, select Install with Google Tag Manager as your installation method.
    On the setup screen, select Install with Google Tag Manager as your installation method.

    Install method

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, re-enable it as follows:
    • Navigate to CookieYes Dashboard > Advanced Settings.
    • In Advanced Settings, toggle the button (to the right) labelled “Support GCM“ to enable the Basic Consent Mode.

This step explains how to set up Google Consent Mode on your Shopify website using Google Tag Manager (GTM) and the CookieYes CMP template.

Step 2.1: Create a Google Tag Manager Account and Container

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

      create container
    2. To install the container on your website, paste both the GTM snippets immediately after opening your website’s <head> and <body>tags in the {/} theme.liquid section on your Shopify Dashboard.

      container script

    Step 2.2: Add the CookieYes CMP Template in GTM

    To add the CookieYes CMP template to your workspace,

    1. In your GTM account, click Tags from the left sidebar.
    2. Click New to create a new tag.

      Add new tag
    3. Click Tag Configuration.
    4. Select Discover more tag types in the Community Template Gallery.
    5. Search for CookieYes CMP. Alternatively, you can access the template directly using the provided template link.
    6. Select the CookieYes CMP template and click Add to workspace > Add to add it to your GTM installation.

      Add to workspace

    Step 2.3: Configure the CookieYes CMP Tag

    In the CookieYes CMP tag configuration, enter the CookieYes website key, set the other fields to appropriate values, and save the tag after naming it.

    tag confg

    Get the Website Key

    Follow the steps below based on your account type.
    For New Users

    1. Return to the CookieYes setup screen and locate the Website Key.
    2. Click the Copy key to copy it to your clipboard.

      copy key
    3. Paste the key into the Website Key field in the CookieYes CMP tag in GTM.

    For Existing User

    1. Log in to your CookieYes account.
    2. Navigate to Advanced Settings and click Get Installation Code.

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

      Copy code from advance settings
    4. Paste the copied Website Key into the Website Key field in the CookieYes CMP tag in GTM.

    Step 2.4: Add Default Consent Setting:

    1. In the CookieYes CMP tag configuration, click Add Setting.
    2. For each cookie category, select Enabled or Disabled based on your requirements.
    3. In the Regions field, enter ISO-standardised region codes (ISO 3166-2) to geo-target specific regions, or, if you prefer not to geo-target your banner to specific regions worldwide, enter All to apply the settings globally. Refer to the ISO 3166-2 standard for the appropriate region codes.
    4. Click Add to save the consent setting.

      gcm

    Step 2.5: Set the Trigger

    1. Select Consent Initialization – All Pages as the trigger for the CookieYes CMP tag.
      This trigger is required for Google Consent Mode to function correctly.
    2. Click Save to complete the tag configuration.
      Click Save to complete the integration of CookieYes with the Google Consent Mode.

      consent

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


      save tag

    At this stage, CookieYes is configured in Google Tag Manager. You will publish the container once you have completed the remaining setup steps.

    Step 3: Adding the shopify.js script

    To integrate with Shopify’s Consent Settings, follow the steps below.

    1. Log in to your Shopify Admin Dashboard.
    2. From the left sidebar, select Online Store, then click Themes.

      themes
    3. Locate your active theme, click the three-dot (⋯) menu, and select Edit code.

      edit code
    4. Under the Layout section, select {/} theme.liquid.
    5. Paste the following script immediately after the opening <head> tag:
      <script src="https://cdn-cookieyes.com/common/shopify.js"></script>

      shopify.js
    6. Click Save.

    Step 4: Enable Shopify Customer Privacy Settings

    1. Navigate to Settings of your Shopify Admin Dashboard.

      settings
    2. From the left sidebar, select Customer Privacy and click on Cookie Banner. Also, verify that CookieYes GDPR Cookie Banner is listed under Installed Privacy Apps.


      Customer privacy
    3. On the Cookie Banner page, click More actions and select Use custom cookie banner.

      More actions
    4. In the Use Custom Cookie Banner modal, select the regions where you want Shopify to collect marketing and analytics data for customers, then click Confirm.

      confirm

    Note

    CookieYes will notify Shopify when consent is given or revoked. Shopify will collect marketing and analytics data only if consent is obtained in the specified regions.

    Step 5: Verify Integration

    To verify GCM integration on your website,

    1. Navigate to Advanced Settings in the CookieYes Dashboard.
    2. Click the Check Now button against the Check GCM status. If the configuration is correct, you will see a success message stating, ‘No error detected’. If you encounter any errors after running this check, refer to our GCM Troubleshooting Guide to resolve them and check again.

    Note

    The Check GCM status verification does not work for password-protected Shopify websites.

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

    Should you encounter any issues, our dedicated GCM support team are here to assist you.

    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.

    Conclusion

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

    Was this article helpful?

    Have more questions?

    Reach out to us and we'll answer them.

    Contact us