How to Integrate Google Consent Mode V2 on your Shopify store

Product Updates

15 mins

Dilyana Simeonova
February 13, 2024
How to Integrate Google Consent Mode V2 on your Shopify store

A Shopify Merchant's Guide to Google Consent Mode V2 Integration

Hello Shopify merchants! With the digital landscape evolving rapidly, protecting your store's compliance with data privacy laws has never been more critical. That's why we're here to walk you through the latest update from Consentmo - the integration of Google Consent Mode V2 (GCM V2). This guide is designed to simplify the integration process, making compliance a breeze for your store.

What is Google Consent Mode V2?

Google Consent Mode V2 (GCM V2) is a tool made by Google. Website owners, including Shopify merchants, must now change how they get user consent for cookies and data collection. GCM V2 respects your visitors' privacy choices. It also lets you gather data that can help with your online store optimization.

GCM V2 introduces a flexible framework. It changes how Google’s services on your website based on each user's consent. The tool will change how it collects and processes data based on what your visitors agree to. This will keep you compliant with strict global data protection laws like the GDPR.

Dynamic Adjustment of Services

One of the key features of GCM V2 is its dynamic response to user consent. For example, if a user does not consent to tracking cookies, Google Analytics will operate in a limited mode. It will not use cookies or collect identifying data. This respects the user's privacy. However, if a user consents to these cookies, Google Analytics will fully activate. It will give you detailed insights into user behavior on your site.

Google Consent Mode V2 works smoothly with Google Ads, Analytics, and Tag Manager. This integration guarantees that you can manage marketing campaigns effectively. You can analyze performance metrics and deploy tracking tags, all with user consent.

Benefits for Shopify Store Owners

For Shopify merchants, adopting Google Consent Mode V2 (GCM V2) provides several significant advantages:

  • Real-Time Adaptability: The system dynamically adjusts to visitor consent, ensuring ethical data collection and legal compliance.
  • Build credibility and Compliance: GCM V2 respects user privacy preferences, enhancing customer trust and securing their continued engagement.
  • Optimized Marketing and Analytics: The tool allows essential functions like Google Analytics and Google Ads to operate within user consent limits, enabling effective site traffic analysis and targeted advertising.
  • Driving Sales and Improving Customer Experience: By maintaining the functionality of analytics and ads, GCM V2 supports key activities that drive sales and enhance the shopping experience.
Meeting Global Privacy Regulations

Google Consent Mode V2 is designed to comply with stringent global privacy regulations:

  • Alignment with Privacy Laws: GCM V2 adapts to regulations such as the GDPR and CCPA, helping protect your business against legal challenges regarding data privacy.
  • Proactive Compliance and Strengthen Confidence: The system manages data interactions proactively, staying ahead of compliance requirements and minimizing legal risks.
  • Boosting Customer Confidence: Demonstrating a commitment to privacy strengthens customer relationships, encouraging loyalty and fostering a positive brand image.
  • Enhancing Reputation: By prioritizing user privacy, your store not only gives credence but also establishes itself as a leader in privacy-conscious business practices.
Integrating GCM V2 for New Consentmo Users

If you're setting up GCM V2 for the first time, follow these steps to make sure a smooth integration:

1. Access Your Shopify Admin: Start by logging into your Shopify Admin dashboard.

2. Navigate to Your Online Store: Click on the 'Online Store' link located in the left sidebar to access your theme settings.

3. Edit Your Theme Code: From the 'Actions' dropdown, select 'Edit Code'. This will take you to a page where you can edit your store's theme files.

4. Update the theme.liquid File: Locate the theme.liquid file in the list on the left. Open it and look for the opening <head> tag. Directly after this tag, insert the line {% render 'gcm-integration-script' %}. This guarantees that the Google Consent Mode script executes right at the start before any other tracking services like Google Tag Manager or Google Ads kick in.

5. Create a New Snippet: In the 'Snippets' section of your theme files, create a new liquid file named 'gcm-integration-script.liquid'.

6. Insert the Integration Script: Copy the content of the integration script provided by Consentmo here and paste it into the gcm-integration-script.liquid file you just created. The final result should look like this:

For Existing Consentmo Users with GCM Integrations

If you've previously integrated GCM with Consentmo, you'll need to remove the old script and follow the new integration steps:

1. Out With the Old: Remove any previous GCM scripts from your theme.liquid file and delete the old JS files.

2. In With the New: Follow the steps for new users to integrate the latest and greatest version of GCM V2.

Google Consent Mode Variants

Google Consent Mode V2 (GCM V2) offers a strong framework for handling user consent. It has two main settings: Before and After consent. This dual-mode feature is designed to ensure that data collection is user-friendly and complies with privacy rules.

Before Consent is Given: By default before the user gives consent, GCM V2 blocks all data categories. This means that no cookies or tracking tech gathers Personally identifiable information (PII) or any other data. This default blocking stance makes sure that your Shopify store respects user privacy from the moment they land on your site. It aligns with privacy-first principles and complies with laws like the GDPR.

After Consent is Given: Once consent is provided by the user, GCM V2 updates its settings dynamically to align with the user's preferences. Google Analytics kicks in when visitors accept the performance cookies and tracks how users behave on your site. This response adapts to maintain that essential Google services, like Google Ads and Google Analytics, function effectively. They enhance your ability to run effective marketing campaigns and site performance analyses, based on the user's level of consent.

Streamlined Data Collection Based on User Preferences: GCM V2 is innovative. It changes the services in real time based on consent status. This means your data collection and processing always match your customers' privacy preferences. That way your store stays compliant and respects your users' privacy choices.


Implementing Google Consent Mode V2 is a significant step towards respecting user privacy while maintaining your store's analytics capabilities. For more detailed information and to get started with Consentmo, visit our app listing page. Dive deeper into Consentmo's features and explore how we can help streamline your store's compliance and privacy practices.

Looking for more insights? Check out our article on the latest updates and steps for integrating Google Consent Mode V2 with Consentmo here. Let's navigate the compliance landscape together, ensuring your Shopify store remains a trusted, privacy-conscious destination for your customers.

If you liked this article, spread the word