The recently launched Google Analytics 4 has many great features, especially for online stores. However, the native integration for Shopify - Google Analytics 4 (GA4) doesn't exist at the moment.

On this page, we have covered everything about Shopify and Google Analytics 4 integration including setup, validation, recommended settings, best practices, and many more.

GA4 is not just a new version of Google Analytics but it also covers amazing new features for Shopify merchants. Follow along the page to get the best out of GA4 & Shopify integration.

As most of you wonder about this, let’s start with what you should do as a Shopify merchant on Google Analytics 4 topic:

Keep your Universal Analytics integration; your existing setup will remain as it is.

Set up Google Analytics 4 on your Shopify store - Google recommends parallel tracking, so do we. ⬇️

Learn the differences between UA & GA4 and how you can take advantage of the power of GA4. ⬇️

Apply recommended settings & best practices. ⬇️

Check the most important GA4 reports for Shopify merchants. ⬇️

Let’s get started to deep-dive!

Chapter 1

How to set up Google Analytics 4 on Shopify

Shopify Google Analytics 4 Chapter 1

You’ve probably heard about the shocking news from Google:

Universal Analytics (The much-appreciated Google Analytics version that we’ve known and used for many years) is being shut down by June 2023.

So, the new version, Google Analytics 4 also known as GA4, will be the only option - replacing UA. You know what’s worse? You won’t be able to carry your data in Universal Analytics over to Google Analytics 4 (GA4), unfortunately.

It simply means that you have to start using GA4 immediately to collect data on your new property.

Don’t panic, though! We got you covered.

Our team has prepared an open-source solution that allows Shopify merchants to set up GA4 using Google Tag Manager without using a paid app. We call it Shopify GA4 Kit.

By using Shopify GA4 kit and following the carefully-crafted, step-by-step instructions; you will have:

  • GA4 up and running on your Shopify store (without an app),
  • Product-level reports on your GA4 account,
  • Purchase data, sales including product-level information,
  • Data layers and Google Tag Manager perfectly work on your store.

All without using Analyzify or any other paid solution! Exciting, isn’t it? So, let’s get started!

Method 1: Shopify GA4 Kit (Do-It-Yourself - Free Option)

We will set up GA4 and e-commerce features using Google Tag Manager(GTM) and data layers. This is the best possible setup method for you because you can use the same GTM setup for other tags such as Google Ads conversions.

We will provide you with everything you need from creating a GTM account to setting up GA4 through GTM on Shopify. Just follow along!

Note: You will get a few external links and additional guidelines within this tutorial to make it easier for you because it is actually a rather complex & multi-step process. We’ve added some the tutorials and the code block on separate pages for you so that we can keep up-to-date and organized.

How to set up Google Analytics 4 on Shopify using Shopify GA4 Kit

  1. Step 1: Add GTM on Shopify
  2. Step 2: Get Shopify Purchase data layer (inc. product-level data)
  3. Step 3: Add data layer into the Shopify checkout page
  4. Step 4: Add data layer into the Shopify product pages
  5. Step 5: Download Shopify GA4 Kit's GTM Container(Free)
  6. Step 6: Import GTM Container
  7. Step 7: Add your GA4 measurement ID
  8. Step 8: Pause other GA4 tags on GTM
  9. Step 9: Validate your GA4 setup using GTM's preview mode
  10. Step 10: Complete your tests and publish
  11. Step 11: Discover Google Analytics 4
Step 1: Add GTM on Shopify

If you already have Google Tag Manager installed on your Shopify store, including the thank you page, you may skip this step. Please make sure that you set up GTM correctly as it will be the main operator of our setup.

You can follow our separate tutorial for this topic to execute the setup and validate GTM installation on Shopify.

Step-by-step Tutorial: Setup GTM on Shopify

Move to the next step once you set up and validate GTM on your Shopify store. We will use GTM to complete our GA4 setup. So it is a required action.

Step 2: Get Shopify Purchase data layer (inc. product-level data)

Analyzify offers you a free, open-source purchase and product view data layers for Shopify. This data layer is the new version including the product-level data.

Click on the following link for our Shopify Purchase Data layer page to get the most cutting-edge code block. Copy the code block - and keep that tab open because we will use more codes from the same page. Make sure you copy the data layer code correctly.

Code Block: Analyzify Purchase Data layer for Shopify

Move to the next step once you get the code correctly.

Step 3: Add data layer into the checkout

Now visit your Shopify Admin > Settings > Checkout > Order Status Page > Additional Scripts - and paste the code right below your GTM container code.

You should already have the GTM container added at Step 1. Please go back to that step if you don’t see your code here.

If you have another purchase data layer added, you can keep both because this one is named differently. Also, feel free to delete your old data layer if you are using it for GA4 - because you are provided with the most advanced one here.

If you aren't familiar with adding codes into your "Checkout Additional Scripts" page, you can visit the previous page that we opened and follow the Step 2 there.

Move to the next step if you have your Google Tag Manager container code, and Shopify purchase data layer together on your Additional scripts.

Step 4: Add data layer into the product page

Visit the Shopify Product Data layer section of the same page to find the code block there. You will also see the steps that you need to add to your product pages.

Follow from Step 1 to Step 4 - up until the GTM actions. Don’t move on with GTM actions because we will do it here in the next step.

Now you successfully have added the needed data layers into your Shopify store for GA4 setup including GA4 e-commerce reports.

Shopify GA4 Kit - Product Page Data Layer

Data layers aren't enough by itsef, now we will need to do the steps within GTM.

Move to the next step if you have completed the steps above correctly.

Step 5: Download GTM Container

The next steps will be done through Google Tag Manager. You need to create GA4 tags, triggers, and variables for product view and purchase events.

This is a complex and time-consuming process. We have prepared a ready-to-go Shopify GA4 & GTM container. You will just need to download it, import it into your GTM account and add your measurement ID.

to request & download Analyzify GA4 & GTM Set for Shopify. You will receive an automatic email from us that will include the GTM container with the following content:

Shopify GA4 Kit - Download GTM Container

This is all you need for GA4 e-commerce tracking, move to the next step once you download the container to your computer.

Step 6: Import GTM Container

Now it is time to import the GTM container you have downloaded.

Step 6.1 - Login to your GTM > Admin (Top menu) > Import Container

Shopify GA4 Kit - Import GTM Container

Step 6.2 - Choose the JSON file you downloaded through our email

Step 6.3 - Apply the following settings Existing Workspace > Merge > Rename Conflicting tags

Step 6.4 - Confirm

Step 7: Add your GA4 measurement ID

This is the only change you will make on the GTM container.

Step 7.1 - Click the variable: ***UpdateMe*** GA4 Measurement ID (G-). You can also find it on the Google Tag Manager > Variables (Left-Menu) > User-Defined Variables

Add your GA4 ID

Step 7.2 - Paste your GA4 measurement ID here.

Step 7.3 - SAVE

Here are some tutorials if you need help with:

Step 8: Pause other GA4 tags
Pause other GA4 tags

If you have other GA4 tags on your GTM that you have added earlier, you should pause them to prevent double-tracking issues.

Choose them just like in the video and then click the PAUSE icon on the right-top corner.

Step 9: Validate your GA4 setup

Now we will test the data and the setup using GTM’s Preview Mode. You can get help from screencast if you aren't familiar with Google Tag Manager Preview Mode & Tag Assistant.

  • Step 9.1 - Click Preview on the right-top corner of the GTM page.
  • Step 9.2 - Add your store URL and click connect. The store should open and it should write “Tag Assistant Connected” on the right bottom corner.
  • Step 9.3 - Visit a product page and go back to “Preview Mode: Tag Assistant”.
  • Step 9.4 - You should be seeing the “analyzify_productDetail” event on the left. Click on it.
  • Step 9.5 - You should be seeing the “GA4.02 - Event - View Item” tag fired. Click on it.
  • Step 9.6 - Choose “Display Variables as Values” from the right top corner.

Validate GA4 setup

Step 9.7 - Double-check here the

  • Product ID
  • Product Name
  • Product Price
  • Google Analytics 4 measurement ID.

If something is not working as expected:
Re-visit the previous steps and make sure you followed them properly.
Check out and follow our detailed Youtube video on this topic.

Step 10: Complete your tests and publish
Test Publish

You can also test the purchase event the same way. We strongly recommend you to follow our Youtube video for further tests and information.

Now you can publish the changes and enjoy your GA4 E-commerce setup. Click SUBMIT at the right top corner of Google Tag Manager, write a container name and PUBLISH.

Method 2: Shopify Apps (Paid)

There are several Shopify apps in the market that support Google Analytics 4. These apps add data layer codes into your store and then pass the relevant data to Google Analytics 4 - mostly using Google Tag Manager.

Our product, Analyzify is a world-class solution for Google Tag Manager, Google Analytics 4, Facebook Pixel, Google Ads Conversions, and many other data-analytics integrations. Analyzify empowers over 600 stores now with a 5-star rating - being the top reviewed app on its category on Shopify store.

Feel free to check out other Shopify apps for Google Analytics 4 and make your own choice. We recommend you read the client reviews carefully.

Method 3: Shopify Pixels (*New)

Shopify recently launched this amazing feature called Shopify Pixels. Our team at Analyzify has worked hard to prepare an open-source solution for Shopify merchants to set up Google Analytics using Shopify Pixels. And here we are - with an amazing result.

How to set up Google Analytics 4 using Shopify Pixels?

  • Step 1: Visit Shopify Admin > Settings > Customer Events > Create a Custom Pixel
  • Step 2: Name the pixel as: Analyzify Open-Source GA4 v1.0 and move on
  • Step 3: Copy Analyzify's open-source pixel for Shopify - GA4 integration
  • Step 4: Create a new Google Analytics 4 property for testing purposes
  • Step 5: Copy the new GA4 property's measurement ID and replace the G-XXXXXXXXX with your new ID
  • Step 6: Paste the code into the pixel, SAVE and connect
  • Step 7: Debug the GA4 setup using Google Analytics's DebugView and Real-time reports
  • Step 8: Cross-compare the GA4 results within a week.

We strongly recommend using Shopify Pixels with attention. Please make sure to watch the video (below) for the detailed steps. We have also covered the risks and cons using the Shopify Customer Events.

Chapter 2

Google Analytics 4 vs. Universal Analytics

Shopify Google Analytics 4 Chapter 2

GA4 is using a completely new technology and infrastructure that allows many new, exciting features and reports. Some of them are:

  1. Predictive analysis powered by Machine Learning (ML) and Artificial Intelligence
  2. Empowered Segments & Audiences features
  3. Creating totally custom reports (tables or visualizations for cohorts, paths, funnels, or segments)
  4. Automatically collected events (such as scroll, video view, first_time_visit, and many others)
  5. Collecting up to 30 conversions and 300 events
  6. Choosing the attribution model you wish
  7. Customizing any default tables & reports & menu
  8. AI-powered anomaly detections

Check out the following guides/help documents to learn more about the topic:

Chapter 3

How to create a GA4 Account

Shopify Google Analytics 4 Chapter 3

Let’s make it clear first: You can not create a Google Analytics 4 account, contrary to what the title suggests. You can just create a Google Analytics account with Google Analytics 4 property.

As Google Analytics 4 (GA4) is the new and default version, Google Analytics automatically creates a GA4 property for you when you want to create a new account.

Alternatively, you can also create a GA4 property using your existing Universal Analytics property through GA4 Setup Assistant. By doing so, you can link the accounts so some settings are shared between the properties.

Chapter 4

Validation & Key Reports

Shopify Google Analytics 4 Chapter 4

Doube-checking is something that you would always want to do in the world of data analytics. If you have your GA4 setup done, it is time to double-check if that’s working properly - while discovering the most important reports and features of GA4.

 Product Performance Report
Product Performance Report

Check this report to see which products are performing the best. From a performance standpoint, Cart-to-View rate and Purchase-to-View rate metrics are important here.

E-commerce Purchase Item
GA4 Product Attributes

And as for validation, you need to make sure the product names are correctly visible here. From the “Item Name” dropdown you can also change the main dimension to category, brand, Product ID and double-check if the data is correctly being passed.

Traffic Acquisition Report
Traffic Acquisition Report

This is one of the most important reports because it shows the traffic resources and the performance by channels of your Shopify store. You can assess each channel’s performance using the metrics here.

If you see social media traffic and payment providers grouped as “referral” - that’s a sign of a problem and you need to fix it. You’ll see the solutions (UTM and Referral Exclusions) below under recommended settings.

Order ID & Revenue Report
Order ID & Revenue Report

You can make a custom report and see Order IDs and recorded revenue of the specific orders. We use this report to see the orders that are being counted in Google Analytics 4 and cross-compare data with the original Shopify orders. As this is a custom report, you need to take a few steps to complete it. Follow this guide: GA4 & Shopify Data Validation

Chapter 6

FAQ on GA4

Shopify Google Analytics 4 Chapter 6

Analyzify's core setup is based on Google Analytics 4 (GA4). Hence, we strongly recommend using GA4 with Analyzify so that you can take advantage of the new and default version of Google Analytics.

Keep in mind that you should use Universal Analytics (UA) and GA4 together (aka. parallel tracking). However, you are free to pause the GA4 tags on Google Tag Manager if you don't want to use them together for a specific reason.

Technically, there is not really much difference. Upgrading from UA to GA4 only carries over some settings, which is recommended.

You can follow our related guide on creating a new GA4 account through UA.

Google Analytics 4 (GA4) is the new and default version of Google Analytics. Even its first version has many features that weren't available in Universal Analytics (UA), and it will only get better with time.

On the other hand, GA4 misses some reports and features compared to UA. That's why you should use both of them.

Analyzify's core setup is based on GA4, hence we strongly recommend using GA4 with Analyzify so that you can take advantage of the new and default version of Google Analytics.

No. You should use Universal Analytics (UA) and Google Analytics 4 (GA4) together. Google recommends parallel tracking, and so do we.

Analyzify's core setup is based on GA4, hence we strongly recommend using GA4 with Analyzify so that you can take advantage of the new and default version of Google Analytics.

Google Analytics 4 (GA4) is the new and default version of Google Analytics, whereas Universal Analytics (UA) is the old version. We have a long-form content where you can read a detailed comparion between GA4 and UA.