A Guide to Setting Up Google Analytics 4 for ShopifyPosted by Nitin Jain / November 23rd, 2022 / No responses
Google Analytics is a web analytics tool that you can use to monitor and assess the workings of your website. You can obtain a wide range of information and reports on website traffic and visitor behavior with Google Analytics. The platform has both premium and free versions, and it is accessible to everyone with a Google account. Recently, Google Analytics 4 came into existence, and in this article, we will be discussing its integration with Shopify.
Difference between Universal Analytics (GA3) and Google Analytics 4 (GA4)
There are 3 main points based on which the difference between Universal Analytics and Google Analytics 4 is possible:
User Tracking System
The GA3 tracks the users based on sessions, while the GA4 tracking is dependent on events.
With Google Analytics 4, visitor tracking depends on what events they complete on the website. Additionally, GA4 provides better insights into cross-platform, cross-device journeys.
With Universal Analytics, the customers count doubles because app users and web users are present on both platforms.
There is a pre-built report in Universal Analytics that has certain customization options. Comparatively, GA4 provides top-level reports, and in the Analysis tab, you can get more detailed reports. It allows you to analyze the most important facts and gives you a great deal of creative control over how your reports appear.
In Universal Analytics, various actions are possible, including page views and events. In Google Analytics 4, every sort of user interaction is an event. Because of this, a pageview in GA3 is now a screen/page view event in GA4.
Setting It Up
The way it is set up is the third distinction. Unlike GA4, Universal Analytics lets you mix data from your apps and website using a property and view setup.
For universal analytics users, the report grouping base is on audience, behavior, conversions, and acquisition. Although in Google Analytics 4, the user’s report is dependent on users, behavior, demographics, and conversions,
For setting up Google Analytics 4 on Shopify, two widely used methods are present below:
1. Using Google Analytics Tracking Code
a) Tracking Code Addition to the Theme
Edit the theme.liquid file in the Themes section by visiting the online store and pasting your tracking code between head tags. An exemplary code is present below that is usable also.
b) How To Add A Tracking Code To Your Order Confirmation Page
Search for the Settings option, then go to the Checkout option. The modified tracking code addition is possible in the Additional Scripts section. A usable code is present above.
Note: To use the measurement ID from your GA4 data stream, you must change the two instances of G-EXAMPLE in the above two points.
c) Remove Shopify from Referrals in GA4
Preventing the Shopify checkout pages from appearing as referrals in your statistics can help you ensure that your sales are properly credited to the appropriate marketing channels. To accomplish this, open your data stream in Google Analytics, then select “More Tagging Settings” and “List Unwanted Referrals.” MyShopify.com must then be in an exclusion option.
d) Include the Google Analytics 3 Property ID
It is not possible to track people who leave checkout pages, but Google Analytics 3 addition is possible. To achieve this, add your property ID to Google Analytics by navigating to Preferences in the Online Store option.
2. Using Google Tag Manager
a) Addition Of Google Tag Manager to The Theme
Edit the theme.liquid file by navigating to the online store, then the themes section, and paste your Google Tag Manager container code between the head tags. An exemplary code is present below, where you need to replace GTM-EXAMPLE with your container ID in Google Tag Manager.
b) A Page for Order Confirmation: Add Google Tag Manager with A Data Layer
Under the order status page, add the modified tracking code to the additional scripts section by navigating to settings and then checkout options. An exemplary code is present below, where you need to replace GTM-EXAMPLE with your container ID in Google Tag Manager.
c) Exclude Shopify from Referrals in GA4
You can make sure that your statistics accurately attribute your sales to the relevant marketing channels. This is possible by preventing the Shopify checkout pages from showing up as referrals. To do this, open your data stream in Google Analytics, then choose “More Tagging Settings” and “List Unwanted Referrals.” Then MyShopify.com must be present in the exclusion section.
The standard version of Shopify does not allow adding the code for checkout steps. Accordingly, any additional tags you add to your Google Tag Manager container will likewise be absent from the checkout stages. All additional tags that you apply through Google Tag Manager usage are possible while taking this into account. The information those tags track and report is impactful by this.
d) Signing In with Your Universal Analytics Property Id
I advise adding Universal Analytics to your Shopify site because you won’t be able to observe how customers move through the checkout pages in GA4. Go to “Online Store,” then “Preferences,” and enter your property ID under “Google Analytics” to accomplish this.
e) Configuration in Google Tag Manager
You must set up your tag, trigger, and variables inside of Google Tag Manager to send information to GA4. All of these are present below, or you can order our pre-configured container.
Wrapping It Up
In this article, we have explained the steps to set up Google Analytics 4 for Shopify. Aside from that, we can help you with any issues or concerns you may have with our module. We can also help you with custom developments specific to your business requirements. We can assist you so please reach out to us at firstname.lastname@example.org for any assistance with Google Analytics 4 for Shopify.