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.

Implementing GA4 on Shopify involves more than just a simple copy and paste of code snippets. A comprehensive and professional setup is necessary to fully utilize all the features and reporting capabilities, particularly those related to e-commerce.

This article provides an overview of the various GA4 implementation methods available for Shopify. We offer a premium, professional solution and two open-source, do-it-yourself options for the Shopify community.

We have built the solution for Shopify merchants: Analyzify Shopify Data Analytics App & Expert-level support and implementation assistance.

The most loved analytics app. Support by experts.
View Analyzify on Shopify App store

star fullstar fullstar fullstar fullstar full

They have went above and beyond to help me with analytics, ad manager, shopping, tag manger and more. 100% recommend. Support is fast and efficient.

Rogue Rider Industries
star fullstar fullstar fullstar fullstar full

No-coding experience needed. The perfect solution to have a custom implementation without the need for a costly consultancy.

star fullstar fullstar fullstar fullstar full

Fantastic app, invaluable for properly measuring conversions across all channels. Highly recommended. Outstanding service as well, by the way.

star fullstar fullstar fullstar fullstar full

Great support, the app guides you through the whole process, and the customer support is very responsive.

star fullstar fullstar fullstar fullstar full

Very important app to have on your store in order to understand how your ecommerce is doing. With them I feel sure about my analytics data …

Ghidini 1849
star fullstar fullstar fullstar fullstar full

This has been a lifesaver - the service is very useful, they also give advice, not just install and go away. I'd give them 10 stars if I could!

Urban Kit Supply
star fullstar fullstar fullstar fullstar full

They offer outstanding support. The plugin has allowed us to activate all Google Analytics 3 and 4 enhanced e-commerce reports.

Patagonia Chile
star fullstar fullstar fullstar fullstar full

Great app, great service. Fast replies and bug fixing on everything and helpful and proactive regarding optimizations as well. Definitely a thumbs up.

Nordicwoods Nl

Over 1500+ Shopify merchants have trusted our end-to-end data analytics solution that includes audit, done-for-you setup, and data validation.

Method 1: Analyzify

Analyzify offers more than a great piece of software. We help you with the whole implementation process; and make sure your data tracking is working fine. We offer a Done-For-You setup method at no extra cost.

With Analyzify, you can be confident that your data is accurate and actionable. Our experts audit your existing setup, craft a custom solution for your needs, and double-check all important settings. We also follow up with you to make sure everything is working as it should be.

Shopify GA4 Setup by Analyzify

Here are some of the benefits of Analyzify:

  • Data analytics audit & code clean up by experts before the implementation.
  • An expert-level, turnkey setup that is tailored to your store.
  • Shopify <> Google Analytics 4 integration that covers all e-commerce events.
  • Enable GA4’s advanced e-commerce reporting, including user-level metrics.
  • Learn how to use GA4 for your business and view the most crucial reports.
  • Google Ads Enhanced Conversion Tracking and dynamic remarketing setup.
  • Validated data layers and tracking codes for complete accuracy.
  • And much more!

Take your data analytics setup to the next level and install Analyzify now.

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

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.

Before you get started with the GA4 Kit, here are the alternative Shopify & GA integration options:

Shopify's Native
Shopify GA4 Kit
by Analyzify
🏆 Analyzify App
Universal Analytics✅ Included⛔️✅ Included
GA4 E-commerce Data⛔️Limited✅ Included
Data layers & Google Tag Manager⛔️Limited✅ Included
GDPR & Consent mode⛔️⛔️✅ Included
Onboarding & Setup Service⛔️⛔️✅ Included
Customizations & Expert Support⛔️⛔️✅ Included
CostIncluded in
Shopify Plan
Open Source$749/

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.

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

Let's start reviewing the options.

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 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