If you run an online store on Shopify, you know how important it is to track your website's performance. Google Analytics (GA) is a free tool from Google that allows you to track website traffic, user behaviour, and other important metrics. With the recent launch of GA4, it is important to make the switch to the new platform to stay up-to-date with the latest features and capabilities.
This article will walk you through the steps to add GA4 to your Shopify store for new users and migrate to GA4 for universal analytics users. It will also discuss the benefits of using GA4 with Shopify and address some common pain points that online store owners face when it comes to website analytics.
Why switch to Google Analytics 4?
GA4 has a number of advantages over its predecessor, Universal Analytics. One of its most important features is the ability to follow user behaviour across devices and platforms. This is becoming crucial as people interact with websites via a number of devices such as mobiles, tablets, and desktops. GA4 also has more complex tracking features, such as event tracking, which allows you to track CTAs on your website, such as button clicks or form submissions.
Another benefit of GA4 is its emphasis on privacy. As consumers become increasingly worried about their online privacy, GA4 provides numerous features to address these issues, including a more granular approach to data collecting and the opportunity to opt out of data sharing.
Adding GA4 to your Shopify store
If you're new to GA, the process of adding GA4 to your Shopify store is straightforward. First, sign up for a Google Analytics account if you don't already have one.
- Once you have a Google Analytics account, navigate to the Admin section of your account by clicking on the Admin button in the lower left corner of the screen.
- In the Property column, click on the drop-down menu and select "Create Property."
- Choose "Web" as the type of property you want to create.
- Enter your website's URL and provide a name for your GA4 property. (Ex: DigitXL Store)
- Click "Create."
- You'll now see your GA4 property in the "Property" column of your GA account. Click on it to access the tracking code.
- Copy the GA4 tracking code by clicking on the "Global Site Tag (gtag.js)" option.
- Navigate to your Shopify store's admin panel and click on "Online Store" in the left-hand menu.
- Click on "Themes" and select the theme you want to edit.
- Click on the "Actions" button and select "Edit code."
- In the code editor, click on the "theme.liquid" file to open it.
- Paste the GA4 tracking code into the header section of the "theme.liquid" file, just above the closing </head> tag.
- Save your changes and you're done!
Migrating from Universal Analytics to GA4
If you're already using Universal Analytics on your Shopify store, the process of migrating to GA4 is a bit more involved. However, it's still a relatively simple process that you can complete in just a few steps.
GA4 operates differently from Universal Analytics, so get ready to create new tracking tags and update your website code. While some data may not be available in GA4, this is your chance to review your current setup and prioritise what data matters most. Let's dive in!
- Sign in to your Google Analytics account and navigate to the Admin section.
- In the Property column, select the Universal Analytics property you want to migrate to GA4.
- Click on the "Upgrade to GA4" button in the "GA4 Setup Assistant" section.
- Follow the prompts to create a new GA4 property.
- Once you've created your new GA4 property, you'll need to update your tracking code on your Shopify store. To do this, navigate to the "Settings" section of your Shopify store's admin panel and click on "Online Store."
- Click on "Preferences" and scroll down to the "Google Analytics" section.
- In the "Google Analytics" section, enter the tracking ID for your new GA4 property.
- Save your changes and you're done!
**It's important to note that after you've completed the migration, you'll need to update any custom reports or dashboards that you've created in Universal Analytics to work with your new GA4 property**
Benefits of using GA4 with Shopify
Now that you know how to add GA4 to your Shopify store or migrate from Universal Analytics to GA4, let's discuss some of the benefits of using GA4 with Shopify.