Integrating GCM v2 with Magento using CookieYes GTM Template
Last updated on December 14, 2024
Welcome to our detailed guide on integrating Google Consent Mode v2 with Magento using CookieYes. This tutorial provides a step-by-step walkthrough to help you set up GCM v2 on your Magento website, ensuring smooth operation and compliance with privacy regulations.
To integrate GCM, a Magento website with admin access is required.
Setup CookieYes Account
For New Users:
- Create a CookieYes Account:
Create a CookieYes account using your Magento website’s URL. - Customise Your Cookie Banner:
- Select your Banner Language.
- Choose a Layout and Colour that suits your website design.
- Click Next Step to proceed.
- Choose Installation Method:
On the setup screen, select Install with Google Tag Manager as your installation method.

You can customise the cookie banner according to your website’s requirements.
For Existing Users:
- Log in to CookieYes:
Log in to your CookieYes account using your existing credentials. - Remove the CookieYes Script:
Ensure you remove the existing CookieYes script from your website. - 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.

Setting Up the CookieYes GTM Template
Step 1: Create an Account
- Create a GTM account and set up a container.
Step 2: Add CookieYes CMP Template
- In the container dashboard, Click Tags from the left sidebar, and then New as shown.
- First, click on Tag Configuration > Discover more tag types in the Community Template Gallery, and then search for CookieYes CMP. Alternatively, you can get the template from this link. Alternatively, you can access the template directly using this link.
- Select the CookieYes CMP template and click Add to workspace > Add.
Step 3: Configure CookieYes Tag

Insert the CookieYes Website Key
For New User:
- Head to the CookieYes setup screen and locate the Website Key.
- Click the Copy key button to copy the Website Key to your clipboard.
- In GTM, paste the copied key into this field labelled Website Key.
For Existing User
- Head back to the CookieYes account.
- Go to Advanced Settings and click Get Installation Code.
- In the modal, click Install with Google Tag Manager > Copy code.
- In the GTM account, paste the copied key into this field labelled Website Key.
Set Default Consent Settings
- Click Add Setting.
- Select Enabled/Disabled from the drop-down for each cookie category based on your requirements.
- Set the Region by entering the ISO-standardized (ISO 3166-2) codes for the regions you intend to geo-target. If you do not want to geo-target specific regions, enter All in the Regions field. Refer to the ISO 3166-2 standard for appropriate region codes.
- Click Add.
Set the trigger
- Choose Consent Initialisation – All Pages as the firing trigger. This ensures the tag activates before any other tags.
- Click Save.
Step 4: Publish the Container
Click Submit and Publish to Publish your Container version.

Integrate GCM in Magento
- In the Magento Admin Dashboard, navigate to Content > Configuration on the left sidebar.
- This will take you to the Design Configuration page. At this point, you can either select a specific store view to add the code or choose Global to apply it across all store views.Now, click Edit to continue.
- Head back to the Google Tag Manager Account and then Click the Container ID. Copy the
<script>
. - Scroll down to the ‘Other Settings’, click on the HTML Head and add the installation code in the Scripts and Style Sheets field and click on Save Configuration.
- Head to the Google Tag Manager Account and copy the
<noscript>
. - In ‘Other Settings’, click on the Footer and add the installation code in the Miscellaneous HTML and click on Save Configuration.
- To enable the installation code you added, flush the Magento cache.
To flush the cache on your Magento website, first navigate to Systems > Cache Management, and then click on Flush Magento Cache.
Verify GCM Integration
For both new and existing users, follow these steps to verify GCM integration on your website:
- 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!”

After verifying the banner or if you’re an existing user, proceed to verify GCM:
- Navigate to Advanced Settings in the CookieYes Dashboard.
- Scroll to the Google Consent Mode (GCM) section.
- Click the Check Now button against Check GCM status. If the configuration is correct, you will see a success message stating, ‘No error detected’.

To further confirm the setup is correct, follow the steps in our Verification Documentation.
Enabling Advanced Consent Mode in GCM
To Advance Consent Mode,
- Navigate to Advanced Settings in the CookieYes Dashboard.
- To set up Advanced Consent Mode in GCM, toggle the button (to the right) labelled Allow Google tags to fire before consent.
- Return to your GTM account, click Submit, and then Publish to reflect the change on your website.
Conclusion
By following these steps, you will successfully integrate Google Consent Mode with your Magento website using CookieYes CMP. Once the integration is complete, you can perform a website scan directly from the CookieYes Dashboard and explore additional customisations and features.
For further assistance, our dedicated GCM support team are here to assist you.