Moving from Universal Analytics to Google Analytics 4 on Shopify

Ecommerce | 5 min

In This Article

Google has recently announced that it will be disabling Universal Analytics in 2023.

We’ve rounded up everything you need to know about the new go-to solution for tracking analytics with Google Analytics 4.

Find out in this blog post, when you need to transition by, how you can do it whilst minimising any risk, and how the team at Pixel can help.


The current standard tracking of the old Universal Analytics will stop on 1st July, 2023, whilst the processing of 360 properties will end three months later, in October 2023.

All new tracking on Google Analytics will need to be done under Google Analytics 4, but you will still have access to previously processed UA data for at least six months.

Even though you have some time, we recommend all eCommerce retailers switch over to Google Analytics 4 as soon as possible to ensure your business operations still run smoothly.

This will give you plenty of time to onboard your team to new ways of reporting on previous analytics, as well as understand the reports that GA4 is capable of producing.

What’s the go?

According to Google, time is up for the UA and the model it was built on top of.

“Universal Analytics was built for a generation of online measurement that was anchored in the desktop web, independent sessions and more easily observable data from cookies. This measurement methodology is quickly becoming obsolete.”

Google has said that the event-based measurement model of GA4 is built for the future. It can operate across multiple platforms, doesn’t exclusively rely on cookies, and prioritises user privacy. This ultimately delivers a modern analytics experience to help buinesses navigate ever changing challenges.

“Google Analytics 4 has the flexibility to measure many different kinds of data, delivering a strong analytics experience that’s designed for the future. It allows businesses to see unified user journeys across their websites and apps, use Google’s machine learning technology to surface and predict new insights, and most importantly, it’s built to keep up with a changing ecosystem.”

Here’s a few highlights from us as to how GA4 can support in the delivery of your business goals:

  • GA4 allows you to have a complete view of the customer journey, regardless of what platform they started on, and what platform they converted on.
  • Better understanding of how your marketing activity actually influences conversions.
  • Advanced predictive insights thanks to the always growing industry of machine learning.
  • Manage and minimise the collection of user-level data, keeping you in line with digital compliance.
  • Expanded integration with other Google services.

What are the risks and how can a business mitigate them?

Unable to migrate data

There is no current offical way of migrating data between UA and GA4, meaning you will lose years of data.

We’re not overly worried about this - but a good way to get around it, is pull the important metrics out into your own source of reporting for past years.

Not enough data by July 2023

If you wait until the July 2023 date, you will not have enough historical data to conduct any proper comparisons on website changes or marketing efforts.

You can easily avoid this problem by moving to GA4 as soon as possible.

How do I install Google Analytics 4 on my Shopify store?

The way you set up Google Analytics 4 on Shopify will depend on the version of Shopify you’re using.

If you’re using Shopify Plus, then you can install the tracking code (or Google Tag Manager) on all of the pages of your Shopify store, including the checkout pages.

But if you’re using the standard version of Shopify, then you can install Google Analytics on all the pages of your store, excluding the checkout pages.

Add the tracking code to your theme

You’ll need to Login to the admin panel on your store and navigate to Online Store, and then Themes and edit the theme.liquid file.

You’ll then need to paste your tracking code between the two and tags. Here’s an example of what it might look like for you:

<!-- Global site tag (gtag.js) - Google Analytics --> <script async src=""></script> <script> window.dataLayer = window.dataLayer || []; function gtag() gtag('js', new Date()); gtag('config', 'G-EXAMPLE'); </script>

Important: you’ll need to replace the two instances of G-EXAMPLE with your actual tag.

Adding tracking code to your checkout pages

If youre on Shopify Plus, you can do the following steps to add an event to your order confirmation page:

Navigate to your admin panel, and go to Settings, and then Checkout.

Put this code anywhere within that script file:

<!-- Global site tag (gtag.js) - Google Analytics --> <script async src=""></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-EXAMPLE'); {% if first_time_accessed %} gtag('event', 'purchase', { transaction_id: "{{order.order_number}}", value: {{total_price | times: 0.01}}, currency: "{{ order.currency }}", tax: {{tax_price | times: 0.01}}, shipping: {{shipping_price | times: 0.01}}, items: [ {% for line_item in line_items %}{ item_id: "{{line_item.product_id}}", item_name: "{{line_item.title}}", quantity: {{line_item.quantity}}, currency: "{{ order.currency }}", price: {{line_item.original_price | times: 0.01}} },{% endfor %} ] }); {% endif %} </script>

Again, remember to replace G-EXAMPLE with your Tag ID.

How we can help your Shopify store

So we know what Google’s plan is, why it’s happening, and what you can do about it. But what’s next if you can’t install Google Analytics 4 on your Shopify store?

Get in touch with us and we’ll be more than happy to help.

Let's make magic

We live on the leading-edge of eCommerce.
You can too.