How to Add Google Analytics 4 (GA4) to Your Shopify Store: A Step-by-Step Guide?

Sourabh Upreti
Sourabh Upreti
February 9, 2023

Are you tired of feeling like a detective trying to track down your website's performance?

Well, it's time to put on your Sherlock Holmes hat and solve the mystery of your store's analytics with Google Analytics 4 (GA4).

But don't worry, the process is simple and straightforward, just follow this step-by-step guide to adding GA4 to your Shopify store. You'll have all the data you need to make informed decisions and boost your sales.

Let's set it up. 

What is GA4?

GA4 is a new property that lets you collect data from both website and app sessions. It uses event-based tracking instead of session-based, so your analytics will be more accurate. It offers the same functionality as previous versions, but with a new interface and improved data collection methods.

With GA4, you can even integrate mobile app and website usage data into a single GA property. This means that you can get a more accurate picture of how your customers are using your store, which will help you improve conversion rates and see better ROI.

Difference between Universal Analytics and GA4.

Universal Analytics and GA4 (Google Analytics 4) are both versions of Google Analytics, a web analytics service offered by Google that tracks and reports website traffic. However, they are different in several ways:

1. Data collection.

Universal Analytics uses the traditional tracking code (ga.js or analytics.js) to collect data. This tracking code is placed on the website and tracks the user's interactions, such as page views and clicks, which are then sent to Google Analytics servers.

The data is then processed and used to generate reports on website performance and user behavior. However, the tracking code is not able to collect as much data as GA4.

2. Data model.

Universal Analytics uses a session-based data model, where a session is defined as a group of user interactions on a website within a certain time frame. For example, if a user visits a website, clicks on several links, and then leaves the website, that would be considered one session. The data is then processed and used to generate reports on website performance and user behavior. However, the session-based data model has some limitations, such as not being able to track specific user interactions.

GA4 uses an event-based data model, where an event is defined as a specific user interaction (e.g. button click, page view) on a website. This allows for more granular tracking of user behavior and interactions with the website. The data is then processed and used to generate reports on website performance and user behavior.

3. Features.

GA4 has more advanced features than Universal Analytics, such as cross-device tracking, built-in machine learning, and enhanced measurement capabilities for mobile apps and web apps. Cross-device tracking allows GA4 to track a user's interactions across multiple devices and link them together for a more complete picture of the user's behavior.

Built-in machine learning allows GA4 to automatically identify patterns and insights in the data, making it easier to understand the data and make decisions. Enhanced measurement capabilities for mobile apps and web apps allow GA4 to track user interactions in these contexts and generate reports on performance and behavior.

4. Privacy.

GA4 has more privacy features than Universal Analytics, such as the ability to automatically anonymize IP addresses and control data retention settings. This means that GA4 automatically removes the last octet of an IP address, making it difficult to identify an individual user. 

Additionally, GA4 allows the user to control how long data is retained before it is automatically deleted, giving users more control over their data.

5. Bounce rate and engagement rate.

In Universal Analytics, bounce rate is a default metric, and it is calculated by dividing the number of single-page sessions by the total number of sessions. The engagement rate is not a default metric, but it can be calculated using the data collected by Universal Analytics.

In GA4, both bounce rate and engagement rate are available as default metrics, and they are calculated differently than in Universal Analytics. The bounce rate in GA4 is calculated based on the session-level engagement (such as time spent on the website, pages per session, etc) and not based on the number of pages viewed. The engagement rate in GA4 is calculated by the amount of time spent on the site or the number of events triggered during the session.

6. E-commerce tracking.

In Universal Analytics, e-commerce tracking is available as an add-on called "Enhanced E-commerce" and it requires additional setup and configuration. It allows tracking of user interactions with products, such as product views and add-to-cart events, as well as transactions and revenue.

In GA4, e-commerce tracking is built-in and does not require additional setup or configuration. It allows tracking of user interactions with products, such as product views and add-to-cart events, as well as transactions and revenue. Additionally, GA4 also offers more advanced e-commerce tracking capabilities, such as tracking of checkout steps, purchase refunds, and product lists.

Benefits of GA4 for Shopify.

There are many benefits of GA4 for Shopify, including

1. Faster reporting.

We all know how frustrating it is when the loading bar freezes on a high-traffic website you're tracking with Google Analytics, especially if you're using a 360 account.

Although the user interface for Google Analytics 4 is superficially similar to its predecessor, it's been rebuilt from scratch as a faster and more flexible system.

This more loading!!!

2. Improved data accuracy.

Google Analytics 4 uses a new, more robust method for data collection and has implemented measures to ensure the accuracy of its reports. This means that you’re not only getting faster access to accurate reports but also more reliable results.

3. Custom funnels.

GA4 allows you to create any type of funnel, using a combination of events or pageviews filtered by event properties. It also lets you measure how long customers take to complete the given steps in your funnel. This gives you a better idea of how long it takes to convert your customers, which is key information for any business.

4. Streamlined audience building.

GA4 lets you create audiences by combining events, demographics, or channels. You can then sync these audiences with Google Ads.

For example: if you want to retarget users over the next 30 days who added a product from the "handbags" category to the cart, but never purchased—no problem! Include all users who triggered the add-to-cart event for a particular product category and price, but exclude those that triggered purchases.

Isn't that effective?

5. Predictive insights.

GA4 adds several new features for predictive analytics, including metrics for predicting future purchases (purchase probability) and the likelihood that a customer will leave your business prematurely (churn probability).

For example, you can use predictive metrics like the likelihood that a customer will purchase again or quit. The purchase probability is how likely a user is to make a purchase in the next 7 days, based on their patterns of behavior so far. Churn probability refers to whether or not they will still be an active user after 7 days (vs dropping off entirely).

Predictive insights in GA4

This will allow you to build a more targeted audience.

How to create a tracking ID in GA4 Account?

To begin this, you need a GA4 account. So ensure that you have one. Once created, you can create a tracking ID in GA4 account by following the below steps:

Step 1: Log in to your Google Analytics account and click on “Admin”.

Step 2: Now, from the "Property" section, select "Data stream".


Step 3: Sect the “Add stream” button to create a new stream for your GA4 property. 


Step 4: When you click on the “Add Stream” button, you will see a drop-down. Select the suitable space that you want to create. For this example, we are using “Web”. 


Step 5: Now paste the website UR and give a name to your Stream for identification. Once done, click on “Create Stream”. 


Step 6: When the Stream creation gets created successfully, you will see a window with all the details of the created stream. 


Step 7: Under the section “Tagging information”, click on “Add new on-page tag”. Here you will find gtag.js code and Google tag manager options. 


Step 8: Click on the “Google site tag” option. You will get a code and copy that. 


How to implement the Google Analytics 4 tracking code in Shopify? 

Now you have the code ready. The next step is to add this tracking code to your Shopify store. Here’s the step-by-step method to do the same, 

Step 1: Log in to your Shopify account. Under “Sales channels” find and select “Online store”. 

Step 2: From the drop-down menu, select “Themes”. 

Step 3: On the right-hand side, click on “Actions” near the “Customize” button. 


Step 4: Once you click “Actions”, from the drop-down, select “Edit code” from the options. 


Step 5: Now, paste the code that you have copied from the GA4 analytics in the <head> section of the code. 


Step 6: Once you did, click “Save” and select “Preview”. 


Now you are all set to track everything with accuracy. 

Though you have set everything right, you might still be wondering how to improve the conversion rate on Shopify.  The answer lies in your Google Analytics data. 

Here are some ways how you can leverage Google Analytics data to improve your conversion rate,

1. Track cart abandonment rate.

Cart abandonment is one of the biggest issues that you have to deal with.  If people are abandoning their carts, this means they are not ready to buy from your store yet.  You need to find out why people are abandoning their carts and work on ways to reduce this number.

Though data can help you with numbers, it can’t tell you why people are abandoning their carts. This is where you need the help of BiteSpeed. It helps you leverage WhatsApp to ask customers about the reason behind their cart abandonment. Based on their response, you can send an automated message with discounts or free shipping to get back them to the store.

Reduce abandoned carts

Once you get the data from your customers, you can use it to improve your conversion rate. 

2. Analyze traffic sources.

You need to know where your customers are coming from.  You can use this data to optimize your marketing efforts and create an effective strategy for attracting more customers. If your major traffic source is from social media, you can focus on social media marketing and try to get more people to like your page. If most of your traffic comes from a search engine, you need to optimize your website for search engines.

3. Bounce rate and user experience.

There are many factors that can affect your bounce rate, but the most important one is user experience. If people find your website easy to navigate and visually appealing, they will stay on it longer and come back more often. If you are experiencing a high bounce rate, try to optimize your loading speed, as a high bounce rate directly affects the conversion rate.

What if everything from the loading speed to conversion rates is good, but you are still not getting enough sales? It's called browsing abandonment. 

Browsing abandonment is a common issue that many online businesses face. It occurs when people visit your website but do not complete the transaction.

Guess what? BiteSpeed helps you to solve this too.

All you need is an exit intent pop-up. An exit intent pop-up is a tool that helps you to convert your visitors into customers by showing them an offer when they are about to leave. The idea behind this is simple: if people want to leave your site, they must be interested in something more than just browsing. Showing them an offer at that point can help you convert them into paying customers.

Track, Optimize, and Convert. 

Setting up your site and tracking the metrics is just the half phase of the battle. The rest is what you do with the data. You need to track your website performance, optimize it and make changes as per the results. While the changes on the backend allow you to gather valuable data, your front end should have effective tools to make your Shopify store more customer-friendly, and convert them into customers.

This is where BiteSpeed comes in. It helps you convert your traffic to customers with tons of tools from pop-ups to upselling. It's a one-stop shop to boost your conversion rate by leveraging WhatsApp.

Take care of your back-end analytics with GA4, and we will take care of your front-end conversion with BiteSpeed. Just schedule a free demo, deal?

View all blogs