What Google Analytics 4 means for your online Shopify store.
In March of this year Google Analytics announced the inevitable, it would indeed be sunsetting the Universal Analytics (UA) branch of its Google Analytics software.
This will mean that for users to continue tracking their site's visitors past July 2023, they'll need to update to the newer, more platform-diverse Google Analytics 4 (GA4).
Why is Google moving away from Universal Analytics and what benefit does Google Analytics 4 offer?
Google Analytics 4 primarily focuses on privacy to provide a better user experience. Users are increasingly expecting to have greater understanding and control over their own data, and GA4 has been built to handle these demands from the user, as well as be in a better position to facilitate the business needs when collecting data.
Unlike Universal Analytics, Google Analytics 4 will no longer rely solely on cookies to track user data. It instead uses an event-based model to create new sessions every time a user revisits your site. This gives admins a better understanding of user behaviour on their websites. GA4 also gives users greater control over what their reports focus on, allowing them to go deeper in reporting in areas that their businesses want to focus on.
When should I replace Universal Analytics with Google Analytics 4?
Even though there are still around 15 months until Universal Analytics is gone for good, it’s within your interest to start using Google Analytics 4 sooner rather than later. GA4 will only start collecting data from when the property has been created and the tag has been added to your site, so the sooner you get this done, the more data you will have in GA4 when Universal Analytics is finally shut down.
How do I replace Universal Analytics with Google Analytics 4?
Google has given users the option to easily upgrade their existing Universal Analytics to Google Analytics 4. To do this, simply login to your Google Analytics account, head to the Property column and click on the Upgrade to GA4 prompt.
Before making the changeover to the new platform, we recommend making doubly sure that Google Analytics 4 has implemented all of the features you're currently used to. While Google Analytics 4 is an ever-evolving beast, GA4 in its current state is missing features that Universal Analytics currently provides, such as:
- Complete IP filtering
- Hostname filtering
- Session and product-scoped custom dimensions and metrics
- Data API updates
- Enhanced report filtering and sorting (including regex filters)
- Google Optimize integration
- Recurring email reports
How do I integrate Google Analytics 4 with Shopify?
Assuming you’ve taken the initiative to set up your GA4 property in Google Analytics and have your Shopify site up and running for test transactions at least, you’ll want to take three simple steps to ensure that you're successfully integrating Google Analytics 4 with Shopify.
Step 1: Add the gtag.js code snippet to the theme.liquid file.
Add the gtag.js code snippet to your theme.liquid file so it appears on every page of your site.
You can find this code snippet in your Google Analytics dashboard under Settings > Properties > Data Streams > [Your Chosen Data Stream] > Tagging Instructions.
It will look similar to this:
Step 2: Manage any unwanted checkout and completed transaction referrals.
Ensure the checkout page is not being tracked as a referral when visited and whenever a transaction is completed. You can do this in the same Data Streams panel mentioned previously. Below Tagging Instructions is an option labelled More Tagging Settings. Here you’ll see an option called List Unwanted Referrals wherein you can choose Referral Domain Contains and input "myshopify.com".
Step 3: Add the final gtag.js code snippet to the order confirmation page
Add an additional gtag.js snippet including a purchase event and relevant liquid code to the order confirmation page. You can do this in your Shopify settings panel by going to Checkout, scrolling down the page until you find Order Status Page and pasting the following snippet into the field provided:
Note: This will require testing depending on the set-up of your store and its products.
Implementing these three simple steps allows Google Analytics 4 to process your customers' purchases with the correct marketing attribution as accurately as you would expect, but it’s really the second step that’s doing all of the heavy lifting.
How does Google Analytics 4's integration with Shopify work?
Due to the way Shopify processes transactions in their secure checkout environment (even with a Shopify Plus account), the user journey that began when they landed on your site ends when they leave for your secure checkout.
As a result, Google Analytics 4 determines that a user's journey ended at the point the user visited your checkout page. (This prevents a snippet in checkout.liquid from bridging the gap for you Shopify Plus people!).
So how does adding a purchase event to your order confirmation page help? On its own it doesn’t, it would leave you with a slew of purchases all being attributed as referrals from Shopify, which isn’t the level of granular attribution you’re using Google Analytics 4 for!
It’s the second step, that tells GA4 not to count those referrals from the secure checkout environment that enables you to get the correct user journey attribution, because GA4 will count those multiple sessions as a multi-touchpoint user journey, and as long as you’re not throwing erroneous referrals in, your GA4 results should show you which traffic channels are leading to a purchase.
💚 Reduce your digital carbon footprint with Noughts & Ones
Here at Noughts & Ones, we specialise in developing Shopify websites for planet-friendly businesses that take their environmental commitments seriously by strictly adhering to our own Conscious Development™️ framework and working with a selection of green tools that enable us to code more efficiently.
Get in touch with our friendly bunch of website designers, developers and project managers to find out more about how we can make a meaningful difference together.