Complete guide how to setup GA4 on Shopify
Step 5. How to install Google Tag Manager in Shopify.
Google Tag Manager is a tag management system that allows you to configure and implement tags on your website or mobile application.
If you already have (if not you have to go back to our previous guide steps):
- Shopify store
- Google Analytics account and GA4 property
- Google Tag Manger account
You have now to install Google Tag Manger container code on you Shopify website:
- Go to Google Tag Manger: https://tagmanager.google.com/ and click "Admin".
- In the admin section from Container column please chose "Install Google Tag Manager".
- From the next screen please copy container code:
- Go to Shopify Admin>Online store>Themes>Actions to edit your main template file: theme.liquid and paste there copied already code in the head section here just at the beginning of this section and save changes.
- Go back please to Google Tag Manger and copy also second code snippet:
- In your Shopify theme.liquid paste already copied code to section just at the beginning and save changes.
- Now you will be able to implement all Google Analytics 4 tags just directly in Google Tag Manager. If you are curious how, go to the next section of our guide and find out how to implement GA4 Configuration tag responsible for measuring: page views, scrolls, outbound cliks, site search, video engagment, file downloads events.
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:
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.

If you want to measure traffic on your Shopify website, the first thing is to create Google Analytics account for your 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.


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


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

