Google Tag Manager Integration
GTM gallery template integration for Consentmo GDPR app (Automatic)
You can set the integration for the Google Tag Manager container with our app via the gallery template available in the GTM settings.
This way you will automatically **have an integration for the **Google Consent Mode V2 for all tags running via the GTM container as well.
In the below guide, you can check how this can be set:
Manual integration
Google Tag Manager will be set based on a condition, which is checking one of the cookies that are set by our app. This cookie is storing information on which exact cookie group is blocked currently, either based on the initial state or the preferences of each customer.
When the initial state is set to block the Analytics or Marketing cookie groups, or the customer opts out, the script which is setting the Google Tag Manager will not be executed.
Integration Steps
- Open Shopify Admin.
- Click on Online Store link in the left menubar.
- Click on the Actions dropdown button and select Edit Code from there.
- A new page will open with a list of files on the left side of the screen.
- Create a new liquid file in the **Snippets ** section of the theme files, called
google-tag-manager-integration-script
- After that copy the content of the integration script provided below and paste it in the newly created Snippet file:
- Locate the original Google Tag Manager script and do the following:
Step 1. Copy the content of the Google Tag Manager script and paste it under the line “// The content of Google Tag Manager script goes here” in the integration script again
NOTE: The copied content should not contain the opening<script>
and closing </script>
tags of the script.Step 2. Comment out or delete ** the **original Google Ads scripts and save the changes.
- Open the
theme.liquid
file.
- Locate the opening
<head>
tag and after it, add the following line of code:
<!-- Google Tag Manager integration script Consentmo -->
{% render 'google-tag-manager-integration-script' %}
A reference on the process can also be checked here:
Need help?
In case you need any assistance, please make sure to reach out to our support team via live chat or at support@consentmo.com
Updated on: 02/06/2025
Thank you!