Complete guide how to setup GA4 on Shopify

Step 17. How to setup Google Consent Mode in Google Tag Manager

Published by
Oct 29, 2022

Google Consent Mode is a mechanism built in Google Tag Manager which is responsible for adjusting Google tags behavior to user consent settings. It will for example block data transfer to Google Analytics if cookie consent for analytics_storage will be not granted but will allow data transfer to Bigquery without user specific information

To setup correctly Google Consent mode you need to do 3 things:

  1. Adjust Google Tag Manager settings. Go to Google Tag Manager admin page and “Container Settings” and “Enable consent overview”.
     Adjust Google Tag Manager settings

    Then for each GA4 tag, go to the tag settings and in Advanced Settings >Consent settings section mark “No additional consent required”. All GA tags will have automatically Built-In Consent Checks.

    Consent Mode settings

  2. Add to your main template file and checkout settings the following code before Google Tag Manager container.
    You should also adjust this code to your business and users location: https://developers.google.com/tag-platform/devguides/consent).
    The following code will be great for UE based business and clients:

    ../media/art/9/google-consent-mode-script.jpg

  3. Allow you cookie consent platform (like for example OneTrust) to automatically adjust google consent settings depending on the current user consent settings.

The next step of our guide is to: How to integrate Search Console for GA4 on Shopify

Published Oct 29, 2022 by Piotr Ulacha

Information About the Authors

Piotr Ulacha

Piotr Ulacha is a web analyst. He has 15 years of experience in the digital marketing area. He specializes in implementation of analytical and marketing tracking codes, creating dashboards and data privacy topic. He works currently as a Web Analyst at EverStores.com where he implement tracking solutions for eCommerce brands. Previusly he worked at SellerX with eCommerce brands and at Artegence where he analyses the impact of marketing campaigns for Volkswagen Poland.


If you enjoyed the article please share it:

Other articles about Shopify
Complete guide how to setup GA4 on Shopify.

This guide is all about how to implement Google Analytics(GA4) on Shopify. To setup GA4 on Shopify website we use Google Tag Manger(GTM) and Shopify data layer.

Oct 12, 2022
1. How to create Google Analytics account for Shopify website

If you want to measure traffic on your Shopify website, the first thing is to create Google Analytics account for your website

Published by Piotr Ulacha
Oct 13, 2022
2. How to create Google Analytics (GA4) property for Shopify website

If you have Google Account but you don't have GA4 property yet, because for example you are still using Universal Analytics property (former version of GA4) you have to create new GA4 property.

Published by Piotr Ulacha
Oct 14, 2022
3. How to create Google Tag Manager account for Shopify website

Because we will use Google Tag Manger as a method to implement Google Analytics 4 you have to create GTM account.

Published by Piotr Ulacha
Oct 15, 2022

4. Recommended GA4 property settings for Shopify

If you want to get the best out of Google Analytics 4 apply the following recommended GA4 settings and best practices.

Published by Piotr Ulacha
Oct 16, 2022