Integrating Server-Side GTM Tracking with Consentmo GDPR CMP (Google Consent Mode v2)
Integrating Server-Side GTM Tracking with Consentmo GDPR CMP (Google Consent Mode v2)
Overview
If your Shopify store uses a server-side tracking apps like Elevar, Stape.ie, Addingwell, TagFly, or similar to load your Google Tag Manager (GTM) container, it’s essential that your setup correctly integrates with the Consentmo GDPR CMP app in order to remain compliant with Google Consent Mode v2 (GCMv2).
When GTM is loaded via a third-party method, it will not automatically receive consent signals from Consentmo unless you explicitly integrate the Consentmo GTM template. This template ensures your Google tags tracking (Analytics, Ads, etc.) is triggered in line with each visitor’s consent choices.
Why This Is Important
Google’s Consent Mode v2 requires that all tags respect users’ consent preferences before collecting or sending data. If GTM tracking loads before Consentmo or without its GCMv2 integration:
- Consent signals (ad_storage, analytics_storage, etc.) won’t be applied correctly.
- Tracking may fire before consent, resulting in policy non-compliance.
- Some analytics or conversion tracking events may be lost or misfired.
Using the Consentmo GDPR CMP GTM Template ensures GTM communicates directly with the Consentmo app and Google’s Consent Mode API.
Step 1 — Enable Consent Overview in GTM
- Open your Google Tag Manager workspace.
- Go to Admin → Container Settings.
- Under Additional settings, tick the checkbox Enable consent overview.
- Click Save (top-right corner).
Enabling this option allows you to view and manage consent types in your GTM container and verify which tags respect user consent.
Step 2 — Add the Consentmo GDPR CMP Template
In order to do this you can use the direct link to the Community template for Consentmo GDPR CMP. The link to it is the one below:
- In GTM, go to the Workspace → Templates tab.
- Click Search Gallery and find “Consentmo GDPR CMP”
- Add it to your container.
A new tag called Consentmo GDPR CMP will now appear under Tags.
Step 3 — Configure Default Consent States
- Under Workspace → Tags, click on Consentmo GDPR CMP.
- Hover to the top-right corner of the tag configuration box and click Edit.
- Set the Default Consent States to the following:
Category | Default State |
---|---|
Analytics and Statistics | Denied |
Marketing and Retargeting | Denied |
Functional Cookies | Denied |
Wait for update | 1000 milliseconds |
- Click Save when finished.
Tip: The wait_for_update
delay (1000 ms) ensures GTM waits for the user’s consent before firing tags.
Step 4 — Configure Additional Consent Settings
- Still inside the Consentmo GDPR CMP tag, click Advanced Settings → Consent Settings.
- Under Additional consent required, select No additional consent required.
- Click Save to apply your changes.
Step 5 — (Optional) Adjust Default Consent by Region
By default, all visitors receive a Denied state for all categories until they provide consent.
If you want to customize defaults by region (e.g., allow functional cookies for non-EEA visitors):
- Edit the Consentmo GDPR CMP tag again.
- Find the option Discard Initial Consentmo GDPR Default Consent State.
- Check the box and define:
- Region codes (ISO Country Codes, e.g., US, CA, AU) . Here, you can also check the country codes list: ISO Country Codes
- Categories to modify (e.g., “Functional Cookies”)
- Consent state to apply for that region (Granted / Denied)
- Save your changes, then click Submit → Publish.
A reference on the process can also be checked here:
Step 6 — Verify Integration
Use Tag Assistant (Preview mode) in GTM to confirm that Consentmo signals are working. Look for events such as:
gtag('consent', 'default', …)
gtag('consent', 'update', …)
These should change dynamically as users accept or reject cookies in the Consentmo banner.
Step 7 — Important Note on Uninstall
If you uninstall the Consentmo GDPR CMP app from Shopify, you must also:
- Remove or disable the Consentmo tag/template in your GTM container.
This prevents old consent scripts from running after the app is uninstalled.
Summary
When using server-side GTM loading or third-party tracking apps, you must use the Consentmo GDPR CMP GTM template to connect GTM with Google Consent Mode v2.
This integration:
- Keeps your store compliant with Google’s consent requirements.
- Ensures correct tag behavior based on user consent.
- Provides full control and transparency through GTM’s Consent Overview.
✅ In short: Always install and configure the Consentmo GDPR CMP template in GTM whenever GTM is used for managing the Google tags in your store and it is loaded through a server-side tracking app or custom integration in Shopify.
Need help?
For direct support, you can reach out via the live chat or by sending an email to our support team at support@consentmo.com
Updated on: 10/10/2025
Thank you!