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: the Shopify GA4 Kit.

Easy Integration

Looking for an easy Shopify – GA4 Integration method? We’re happy to offer a solution that is both open-source and free for the Shopify ecosystem: the Shopify GA4 Kit.

Do-It-Yourself - Google Analytics 4 & GTM Setup

Do you like playing around with data tools? We provide you everything you need in a beginner-friendly process: a Google Tag Manager container, data layers, code blocks, and in-depth tutorials.

GA4 E-commerce reports for Shopify

We know you’ve been looking for this: Both product-level and order-level data are included on the Shopify GA4 Kit’s data layers and GTM container.

  • Kit Part 1:
    Data Layers
  • Kit Part 2:
    GTM Container
  • Kit Part 3:
    In-Depth Tutorials
Kit Part 1: Data Layers
Open-source data layers for Shopify merchants - created by true experts.

No secrets, no external files, and no behind-the-door actions.

You can get access to the data layers through the following links. We keep the elements in their own pages so that we can maintain them with ease.

Kit Part 1.1: Shopify “Purchase” Data Layer:

Click here to access the latest version of this data layer.

Kit Part 1.2: Shopify “Product View” Data layer:

Click here to access the latest version of this data layer.

Do not follow the tutorials that are given on the data layer pages. The tutorials for the Shopify GA4 Kit have a different flow, and can be accessed through here.

Shopify “Purchase” Data Layer

Analyzify’s open source purchase data layer passes the order data into GTM and makes it available to use for all tags. On the Shopify GA4 kit, we use it to run GA4’s e-commerce purchase events. The same data layer and variables can be used in all sorts of purchase conversion events, such as: Google Ads, Facebook Pixel, or Bing Ads Conversion.

The purchase data layer includes the following elements:

Order-level Purchased Product-level
Currency Product name
Total value Product price
Shipping price Purchase quantity
Tax value
Transaction ID
Payment Type

Shopify “Product” Data Layer

This data layer can be used for product view events. On our tutorials, you will see that we set GA4’s view item event to make the e-commerce product reports available. The product data layer includes the following elements:

Product view data layer
Product name Product brand
Product price Product category
Product ID Purchase quantity
Kit Part 2: A Pre-built GTM Container for GA4

Get the GTM container into your email be ready to plug in. Make sure to follow the tutorials once you download the file. The GTM container includes tags, variables, and triggers for your setup. You can also re-use them for other tags in the future.

We respect your data and your choices. We will never send a single email without your permission.

Version Upgrade: We have released an important update to Shopify GA4 Kit. You can now download the v2.1. Visit our related Github page for the change history.

You can see the detailed breakdown of the GTM container below.

Name Type Function
GA4.01 - All Pages Tag Google Analytics 4 global configuration tag. It also functions as the "Page View" tag.
GA4.02 - Event - View Item Tag E-commerce event for product page views. It sends the product-level data into GA4 and allows product-level reports to function.
GA4.03 - Event - Purchase Tag Core of all e-commerce reports. It sends order-level and product-level data into GA4 and helps with the attribution.
cEvent - analyzify_productDetail Trigger cEvent refers to Custom Event. This custom triggers works on the product detail pages.
cEvent - analyzify_purchase Trigger Purchase event trigger works on the order completed (aka. "thank you") pages.
GA4 Measurement ID (G-) Variable Your GA4 configuration ID. You need to update this ID once you import the GTM container.
dlv-brand Variable Data layer variable for the product brand.
dlv-currency Variable Currency of the order.
dlv-productId Variable Product's ID.
dlv-productName Variable Product's name.
dlv-productPrice Variable Product's price.
dlv-productQuantity Variable Product's quantity.
dlv-shipping Variable Shipping price value of the order.
dlv-tax Variable Tax value of the order.
dlv-totalValue Variable Total value of the order.
dlv-transaction_id Variable Transaction ID of the order.
Kit Part 3: Step-by-Step Tutorials

We had to involve a few different tutorials as this is a multi-step process which involves many assets. We have created different options so that you can choose whichever you like!

Master Tutorial: Shopify GA4 Setup page

Setting up Shopify GA4 Kit involves 10 main steps. We have added videos and detailed information on each step.

Follow the steps on the related page

Complete tutorial on Youtube

Learn how you can implement the Shopify GA4 Kit on our in-depth, complete, step-by-step tutorial on Youtube.

 

We will soon be adding PDF tutorials and Notion versions as well.

Upgrading from v2.0 to v2.1?

Don’t worry! Everything is set and ready. You need to request the updated Google Tag Manager container using the form below and then you can continue with the upgrade tutorial: Shopify GA4 Kit Part 3 – Upgrade from v2.0 to v2.1

Having issues? Please let us know through Youtube comments or Github issues.

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.

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.

Analyzify App


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 Integration Shopify GA4 Kit by Analyzify 🏆 Analyzify App

Universal Analytics

✅ Included

⛔️

✅ Included

GA4 E-commerce Data

Limited

Limited

✅ Included

Data layers & Google Tag Manager

⛔️

Limited

✅ Included

GDPR & Consent mode

⛔️

⛔️

✅ Included

Onboarding & Setup Service

⛔️

⛔️

✅ Included

Customizations & Expert Support

⛔️

⛔️

✅ Included

Cost

Included in
Shopify Plan

Open Source

$749/one-time-fee

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!

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

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

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.

Click here 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:

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

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

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

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.

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

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.

Play Video about Youtube: Setup GA4 on Shopify using Shopify Pixels

 

Just fill the form and you will receive your pre-built GTM container(GA4 Kit v2.1) to your email instantly.