fbpx

How To Setup Google Analytics 4 On Your Shopify Store: Complete Guide

Google analytics

Universal Analytics is going away for good in July 2023.

This means it is super important that you switch over to Google Analytics 4 if you haven’t already done so.

However, the process of setting up Shopify Google Analytics 4 for Shopify (GA4 Shopify) isn’t as straightforward as it was for Universal Analytics.

But fret not — this guide will walk you through everything you need to know about “how to add google analytics to Shopify?”

Ready? Let’s dive in.

Two Methods To Add Google Analytics To Shopify

You can add Google Analytics to Shopify using either of the two methods:

  1. Manually Setup Google Analytics 4 Using Tag Manager
  2. Automatically Install Google Analytics 4 Through Shopify’s New Integration

Pre-requisites

Before we get into any of this, understand that you need the following for tracking any data for your Shopify store:

  • Google Analytics account
  • GA4 property (not the Universal Analytics property)

Tip: Get a Google Ads account and link it to your GA 4 property if you want to run ads in the future.

Method 1: Manually Setup Google Analytics 4 On Shopify With Tag Manager

Here is the step-by-step process to set up Google Analytics 4 on Shopify using Google Tag Manager.

Step 1 – Create a new Google Tag Manager account or log in to your account if you already have one.

Step 2 – Open the “Admin” tab and click on “Install Google Tag Manager.”

Step 3 – From the two codes you see, copy the first one.

Step 4 – Go to your Shopify store’s admin dashboard.

Step 5 – On the left sidebar, spot “Sales Channel” and click Themes after hovering over the “Online Store” drop-down menu.

Step 6 – Click on the three dots on the right side, and then click “Edit Code.”

Step 7 – On the left sidebar, find and click on “theme.liquid.”

Step 8 – Paste the GTM code that you copied in Step 3. Paste it as high as possible in theme.liquid’s head section of the HTML code. Hit “Save” when you’re done.

Step 9 – Click on “Exit” in the top left corner.

Step 10 – Once you’re back in the main Shopify admin access, scroll down and hit “Settings.”

Step 11 – On the left-side menu, click “Checkout.”

Step 12 – Scroll down till you see the “Order status page” and paste the GTM code under “Additional Scripts.”

Step 13 – Hit “Save” to secure all changes.

That’s it. You’ve successfully installed Google Tags Manager on your Shopify store and can now track data from your online store.

Was The Installation Successful?

Here’s how you can confirm it:

Install the “Google tag assistant” extension on your Google Chrome browser.

Upon successful installation, you’ll see the extension’s icon on the top-right corner of the browser.

Navigate to your Shopify store’s home page and click the Google Tag Assistant icon.

You’ll see a Google Tag Manager tag under “Result of Tag Analysis.”

The tag icon will have a blue or green color, indicating that you’ve successfully installed Google Tag Manager.

On the other hand, if you see a red or yellow colored tag, it means something went wrong during the installation.

Optional But Important Step For GA4 Shopify

If you have the standard Shopify version, you can’t add a tag to the checkout steps. This means they won’t be tracked and can show up as self-referrals in your GA4 reports.

Here’s how you can set up referral exclusions to stop this from happening:

Step 1 – Go to your Google Analytics account and find Data Streams under the “Admin” tab

Step 2 – Select your Data Stream.

Remember: If you’re starting from scratch, you won’t have multiple data streams. A Shopify store has a single Data Stream.

Step 3- At the bottom, select “Configure Tag Settings” and then click “Show All”

Step 4 – Select “List Unwanted Referrals”

Step 5 – Enter “myshopify.com” as the first domain

Step 6 – Hit the “Add condition” button and add your custom domain name

That’s it — the checkout pages now won’t be shown as self-referrals in GA4 reports.

Let’s see method 2 to add GA4 Shopify.

Method 2: Automatically Install Google Analytics 4 Through Shopify’s New Integration

Step 1 – Go to your Shopify store’s admin access and click “Sales Channel.”

This will take your cursor to the search bar on top.

Step 2 – Type “Google Channel” and press the Enter key.

Step 3 – Select the Google Channel app.

This will open a new window.

Step 4 – Here, hit the “Add app” button.

Step 5 – Click on the green “Add sales channel” button in the top-right corner.

Step 6 – Click the green button on the center saying “Connect Google account.”

Step 7 – Click on the “Get Started” button on the top-right, light-blue-colored tab.

Step 8 – Then, from the drop-down menu, select your GA4 property and hit “Connect.”

That’s it – you’ll see the long-awaited message saying, “You’ve successfully set up Google Analytics 4.”

You must be thinking that Method 2 is way easier than Method 1, so why bother and even talk about it?

But there’s a reason we taught you that.

Method 1 vs. Method 2: The Difference

You see, the Google Channel app can’t track the following ecommerce events:

  1. view_cart
  2. select_item
  3. view_item_list
  4. view_promotion
  5. select_promotion
  6. remove_from_cart
  7. add_shipping_info

As a store owner, you can’t afford to miss out on important information like this.

But this is where Method 1 – Google Tag Manager helps. It can help you track desired events by manually adding the tracking code on each page.

So, does it mean you don’t need to install the Google Channel app?

There are two answers to this question.

If you have Shopify Plus: You don’t need the app.

If you have the standard version: You need the app.

Why?

Because you can’t add the GTM code on the checkout pages.

And most businesses have the standard Shopify version, so they need to rely on both for tracking via Google Analytics Shopify.

But there’s another problem; when you use Google Tag Manager + Google Channel app, there could be some repetition (double tracking), and you won’t get accurate data.

Don’t worry – we have the solution.

Let’s learn to configure tag settings the right way.

Configuration For Correct Ecommerce Data Tracking

There are two ways you can do this. In layman’s terms:

  1. You can either stop or command your GTM to track something
  2. Or you can stop or command your Shopify store to track something

Method 1 (Configure Google Tag Manager + Google Channel For Shopify)

Let’s say you want to stop page views from being double-tracked. Here’s what you will do:

Step 1 – Go to your GTM account and edit the GA4 Configuration tag to stop double-tracking the page views.

Step 2 – Repeat the above process for other automatically tracked ecommerce events to ensure there’s no double tracking.

These events usually are:

  1. purchase
  2. view_item
  3. add_to_cart
  4. begin_checkout
  5. add_payment_info

Once you’re done with this, move on to adding the events that Google Channel app doesn’t track.

(We shared a 7-item list above.)

Set up the tags for those events in Google Tag Manager to make sure you don’t miss any important metrics.

Method 2 (Configure Shopify Store For GTM + Google Channel)

Alternatively, you can configure your Shopify settings to make up for any missed events or double tracking.

How?

Go to your Shopify store admin access and remove all the hard-coded data layers for automatically tracked events. These could be in one or multiple themes, so be careful to check all files.

Similarly, you can add data layers for the events that aren’t tracked automatically.

So, this is how you add Google Analytics to Shopify and configure your settings the right way.

It’s a bit overwhelming, we know, but you’ll get the hang of it once you start doing it.

Optimize Your Strategy and Drive Sales Accurate Shopify Tracking

Accurate data tracking is essential for the success of your online store.

Correctly setting up Google Analytics in your Shopify can help you gain valuable insights into how your customers behave, what they like, and how they make purchases. This information ultimately helps you make smart decisions, improve your marketing campaigns, and grow your business.

If you’re struggling with any of it, Mongoose Media can help.

We’re a modern media agency passionate about supporting Shopify store owners with their digital marketing needs. Our dedicated team of experts is well-versed in data tracking and can assist you in setting up Google Analytics 4 effectively.

Get in touch for a free consultation about how we can supercharge your Shopify store’s digital marketing, strategy, and growth!

Leave a Reply

Your email address will not be published. Required fields are marked *

Mongoose Media Agency Logo
Mongoose Media Agency Logo
home
what we offer
Trophy Room
e-commerce
resources
testimonials
book club
Welcome!
How can I help you today?
Mongoose-Brand-Building-Blocks_fav
Support
Mongoosemedia
Mongoosemedia
Get Access to our
Ecommerce Price Guide
Get Access to our
Email Services Price Guide