How to Install Google Analytics 4 on Shopify

Last Updated: May 24, 2022

This article will learn how to install Google Analytics 4 on your Shopify store. Before getting started, make sure that you have set up your Google Analytics 4 property and Shopify account.

If you have a Google Analytics account and are looking to upgrade, then you can refer to my guide to upgrading Google Analytics to GA4.

Now, let us see the steps for installation and validation of Google Analytics 4 on a Shopify store.

How to create your tracking ID in your Google Analytics 4 account

I am assuming that you already have a Google Analytics 4 account created.

If you haven’t created a Google Analytics 4 account and are looking for guidance, refer to my Google Analytics 4 training and tutorial.

Step-1: Log in to your Google Analytics 4 account.

Step-2: Click on the ‘Admin’ section on the left-hand menu.

admin

Step-3: From the ‘Property’ section, select ‘Data Streams’.

GA4 Data Streams

Step-4: Click on the ‘Add Stream’ to create a new stream for your GA4 property.

Add Stream GA4

Step-5: When you click on ‘Add stream’, you will see a drop-down with options to create an IOS app, Android app, or web. Let us select ‘Web’ for this example.

Web Sstream GA4

Step-6: To set up a data stream, provide your website URL and stream name and click on ‘Create stream’.

Setup Data Stream

Step-7: Once the stream is created, you will see your web stream details, as shown below.

Web Stream Details 1

Step-8: Under ‘Tagging instructions’, select new ‘Add new on-page tag’. Here you will find gtag.js code and Google Tag Manager options.

Add on page Google tag

Step-9: Click on the ‘Global site tag’ option to see the code. Copy the code and keep it handy.

Global Site tag

Steps to implement the Google Analytics 4 tracking code in Shopify

Step-1: Log in to your Shopify account.

Step-2: From the left-hand menu, select ‘Online store’, which is under the ‘Sales channels’.

Shopify Online Store

Step-3:  Select ‘Themes’ from the options available under ‘Online store’.

Shopify themes

Step-4: On the right-hand side you will see options to customize your themes. Click on ‘Actions’.

Shopify Actions

Step-5: When you click on ‘Actions’, a drop-down appears. Click on ‘Edit code’ from the options.

Edit code 1

Step-6: Now, paste the code that you have copied from the Google Analytics 4 property in the <head> section of the code.

Before Code Placement:

tracking code placement

After Code Placement:

GA code on Shopify

Step-7: Click on ‘Save’ and preview your Shopify site.

Install Google Analytics 4 on Shopify

How to validate data in Google Analytics realtime reports

Step-1: Navigate to your Google Analytics 4 account and click on ‘Reports’.

reports 1

Step-2: Click on ‘Realtime’.

realtime 1

Step-3: You should now see the users in the realtime reports in the GA4 account.

users in real time reports

Step-4:  Additionally, you can also see the data in events, page title and audiences.

GA4 audiences

views by page title
Event count

You have now successfully installed Google Analytics 4 on your Shopify Store. You can also implement Google Analytics 4 code on your Shopify using Google Tag Manager.

 Follow the steps mentioned in this article about Google Tag Manager Shopify installation Guide.

#1 Google Analytics 4 Intro

  1. What is GA4 (Google Analytics 4) – The Apps + Web Property?
  2. Key Benefits of Using Google Analytics 4 (GA4)
  3. How to upgrade to GA4 (Google Analytics 4)
  4. Google Analytics 4 (GA4) vs Universal Analytics – What is the difference?
  5. Google Signals GA4 – See demographics (gender, age) in Google Analytics 4
  6. Understanding Google Analytics Measurement ID (GA4)
  7. Google Analytics 4 training & tutorial with FREE GA4 ebook
  8. Using the GA4 (Google Analytics 4) Test Property
  9. Google Analytics 4 Sub Properties Tutorial

#2 Google Analytics 4 Integrations

  1. How to connect GA4 (Google Analytics 4) with Google Data Studio
  2. How to link GA4 (Google Analytics 4) with Google Ads
  3. How to link Google Search Console to Google Analytics 4 (GA4)
  4. How to Install Google Analytics 4 on Shopify

#3 Google Analytics 4 Events

  1. GA4 (Google Analytics 4) Event Tracking Setup Tutorial
  2. Understanding Event Parameters in Google Analytics 4 (GA4)
  3. Recommended events in Google Analytics 4 (GA4)
  4. Enhanced measurement events in Google Analytics 4 (GA4)
  5. Automatically collected events in Google Analytics 4 (GA4)
  6. How to set up GA4 Custom Events via Google Tag Manager
  7. Events Report in Google Analytics 4 (GA4)
  8. How to rename events in Google Analytics 4 (GA4)
  9. How to use Google Analytics 4 Event Builder

#4 Google Analytics 4 Conversions

  1. Google Analytics 4 Conversion Tracking Guide – GA4 Goals
  2. How to import conversions from GA4 property to your Google Ads account

#5 Google Analytics 4 Dimensions

  1. GA4 (Google Analytics 4) Dimensions Tutorial
  2. GA4 (Google Analytics 4) Custom Dimensions Tutorial
  3. GA4 User Properties (User Scoped Custom Dimensions) – Tutorial
  4. Event Scoped Custom Dimensions in GA4 – Tutorial

#6 Google Analytics 4 Metrics

  1. GA4 (Google Analytics 4) Metrics Tutorial with Free Google Analytics 4 Ebook
  2. GA4 (Google Analytics 4) Custom Metrics Tutorial
  3. What are predictive metrics in Google Analytics 4 (GA4)

#7 Google Analytics 4 Ecommerce

  1. GA4 (Google Analytics 4) Ecommerce Tracking via GTM – Tutorial

#8 Google Analytics 4 Specialized Tracking

  1. GA4 (Google Analytics 4) Enhanced Measurement Tracking Tutorial
  2. Cross Domain Tracking in GA4 (Google Analytics 4) Setup Guide
  3. GA4 Site Search – Tracking Site Search in Google Analytics 4
  4. GA4 (Google Analytics 4) Scroll Tracking Tutorial
  5. Self-referral Google Analytics 4 – Referral exclusion GA4
  6. GA4 (Google Analytics 4) Data Import Tutorial
  7. Google Analytics 4 Content Grouping – Create Content Groups in GA4
  8. How to track single page apps in Google Analytics 4 (GA4)

#9 Google Analytics 4 filters

  1. GA4 filters – Understanding data filters in Google Analytics 4
  2. How to create and test filters in Google Analytics 4 (GA4)?
  3. Exclude internal traffic in GA4 (Google Analytics 4) via IP filter

#10 Google Analytics 4 Explorations

  1. Free Form Report in GA4 (Google Analytics 4) – Exploration Report
  2. How to use the user lifetime report in Google Analytics 4 (GA4)
  3. How to use Path exploration report in GA4 (Google Analytics 4) – Path analysis
  4. How to use Segment Overlap Report in Google Analytics 4 (GA4)
  5. How to use the Funnel Exploration Report in GA4 (Google Analytics 4) – Funnel Analysis
  6. Cohort Exploration Report in Google Analytics 4 (GA4)
  7. How to Create Landing Pages Report in Google Analytics 4 (GA4)

#11 Google Analytics 4 Advanced

  1. Understanding Google Analytics 4 Sessions
  2. GA4 (Google Analytics 4) Measurement Protocol Tutorial
  3. How to build comparisons (advanced segments) in Google Analytics 4 (GA4)
  4. Understanding Automated Insights in Google Analytics 4 (GA4)
  5. Understanding Channel Groupings in Google Analytics 4 (GA4)
  6. Understanding Data Sampling in Google Analytics 4 (GA4)

#12 Google Analytics 4 Reporting

  1. How to create custom insights in Google Analytics 4 (GA4)
  2. How to use Debug View report in Google Analytics 4 (GA4)

#13 Google Analytics 4 Attribution

  1. Guide to Attribution Models in GA4 (Google Analytics 4)
  2. How to Change Attribution Models in GA4 (Google Analytics 4)?
  3. GA4 (Google Analytics 4) Conversion Paths Report in Attribution
  4. GA4 (Google Analytics 4) Model comparison report in Attribution
  5. Advertising Snapshot in GA4 (Google Analytics 4) Attribution

#14 Google Analytics 4 Audiences

  1. GA4 Audiences – Creating custom audience in Google Analytics 4
  2. How to create a remarketing audience in Google Analytics 4 (GA4)
  3. Understanding Audience Triggers in Google Analytics 4 (GA4)
  4. Google Analytics 4 (GA4) Predictive Audiences – Tutorial

#15 Google Analytics 4 BigQuery

  1. GA4 BigQuery – Connect Google Analytics 4 with BigQuery
  2. How to connect and export data from GA4 to BigQuery
  3. events_ & events_intraday_ tables in BigQuery for GA4 (Google Analytics 4)

Frequently Asked Questions About How to Install Google Analytics 4 on Shopify

How to install GA4 on the Shopify website?

Follow the below steps to install GA4 on the Shopify website
Step-1: Log in to your Google Analytics 4 account.
Step-2: Click on the ‘Admin’ section on the left-hand menu.
Step-3: From the ‘Property’ section, select ‘Data streams’.
Step-4: Click on the ‘Add Stream’ to create a new stream for your GA4 property.
Step-5: Select data stream as “Web”
Step-6: Once the data stream is created, under ‘Tagging instructions’, select new ‘Add new on-page tag’. Here you will find the gtag.js code
Step-7: Click on the ‘Global site tag’ option to see the code. Copy the code and keep it handy.
Step-8: Log in to your Shopify account.
Step-9: From the left-hand menu, select ‘Online store’, which is under the ‘Sales channels’.
Step-10: Select ‘Themes’ from the options available under ‘Online store’.
Step-11: On the right-hand side you will see options to customize your themes. Click on ‘Actions’.
Step-12: When you click on ‘Actions’, a drop-down appears. Click on ‘Edit code’ from the options.
Step-13: Now, paste the code that you have copied from the Google
Step-14: Click on ‘Save’ and preview your Shopify site.

Does the Shopify website automatically track eCommerce events for GA4?

No, the Shopify website cannot track eCommerce events automatically. You need to track it manually either using gtag.js or Google Tag Manager.

Can you implement Google Universal analytics and GA4 on the Shopify website?

Yes, you can implement both Google Universal analytics and GA4 on the Shopify website. It is advised to have both analytics versions to be implemented. You can easily do it using gtag.js or Google Tag Manager.

Other articles related to GA4 (Google Analytics 4)

#1 GA4 Intro

  1. What is GA4 (Google Analytics 4) – The Apps + Web Property?
  2. Key Benefits of Using Google Analytics 4 (GA4)
  3. How to upgrade to GA4 (Google Analytics 4)
  4. Google Analytics 4 (GA4) vs Universal Analytics – What is the difference?
  5. Google Signals GA4 – See demographics (gender, age) in Google Analytics 4
  6. Understanding Google Analytics Measurement ID (GA4)
  7. Google Analytics 4 training and tutorial
  8. Using the GA4 test property

#2 GA4 Integration

  1. How to connect GA4 (Google Analytics 4) with Google Data Studio
  2. How to link GA4 (Google Analytics 4) with Google Ads
  3. GA4 BigQuery – Connect Google Analytics 4 with BigQuery

#3 GA4 Events

  1. GA4 (Google Analytics 4) Event Tracking Setup Tutorial
  2. How to set up GA4 Custom Events via Google Tag Manager
  3. GA4 (Google Analytics 4) Enhanced Measurement Tracking Tutorial
  4. Events Report in Google Analytics 4 (GA4)
  5. GA4 User Properties (User Scoped Custom Dimensions) – Tutorial
  6. Event Scoped Custom Dimensions in GA4 – Tutorial

#4 GA4 Conversions

  1. GA4 (Google Analytics 4) Conversion Tracking Guide
  2. How to import conversions from GA4 property to your Google Ads account

#5 GA4 Dimensions and Metrics

  1. GA4 Metrics Tutorial with Free Google Analytics 4 Ebook
  2. GA4 Custom Metrics Tutorial
  3. GA4 Dimensions Tutorial
  4. GA4 Custom Dimensions Tutorial

#6 GA4 Ecommerce

  1. GA4 (Google Analytics 4) Ecommerce Tracking via GTM – Tutorial

#7 GA4 Specialized Tracking

  1. Cross Domain Tracking in GA4 (Google Analytics 4) Setup Guide
  2. GA4 Site Search – Tracking Site Search in Google Analytics 4
  3. GA4 (Google Analytics 4) Scroll Tracking Tutorial
  4. How to Install Google Analytics 4 on Shopify
  5. Self-referral Google Analytics 4 – Referral exclusion GA4
  6. GA4 Data Import Tutorial

#8 GA4 filters

  1. GA4 filters – Understanding data filters in Google Analytics 4
  2. How to create and test filters in Google Analytics 4 (GA4)?
  3. Exclude internal traffic in GA4 (Google Analytics 4) via IP filter

#9 GA4 Analysis Hub

  1. Analysis Hub Google Analytics – Exploration Report in GA4 (Google Analytics 4)
  2. How to use the user lifetime report in Google Analytics 4 (GA4)
  3. How to use path analysis report in Google Analytics 4 (GA4)
  4. How to use Segment Overlap Report in Google Analytics 4 (GA4)
  5. How to use the Funnel Analysis Report in Google Analytics 4 (GA4)

#10 GA4 Advanced

  1. How to use Debug View report in Google Analytics 4 (GA4)
  2. Understanding GA4 measurement protocol
  3. How to create a remarketing audience in Google Analytics 4 (GA4)
  4. GA4 Audiences – Creating custom audience in Google Analytics 4
  5. How to build comparison (Advanced segment) in Google Analytics 4 (GA4)

#11 GA4 Reporting

  1. How to create custom insights in Google Analytics 4 (GA4)

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!