Alo Agency: Building Tools For Commerce

Shopify and GA4 analytics setup

On October 14, 2020, Google launched GA4 as the new default within Google Analyitcs. This is a huge change both in how Google Analytics captures data and how you interact with it via the dashboards. GA is everywhere - media sites, social media sites, iOS and Android apps, and as we'll discuss, ecommerce sites. This new system acts as one umbrella for all types of analytics tracking functionality.

If you're operating a Shopify store you should already be taking advantage of the tight integration the platform provides with the Enhanced Ecommerce setting enabled. So what's the fuss with the new Google Analytics version, and how do you upgrade your Shopify store to GA4?

How can I tell if I have GA4 enabled?

There are a few ways to tell

  • Standard Google Analytics uses the Universal Analytics tag that looks like this: UA-1234
  • GA4 uses a "Measurement ID" that looks like this: G-1234
  • The GA4 dashboard is entirely new.

learn more here:

"Analytics snippet does not look valid"

This is the error you will get now when trying to add a new GA4 Measurement ID instead of a standard. Universal Analytics ID.


If you want to enable GA4 on your Shopify store you'll need to add the code directly to your theme files. There is an in-depth guide available from Elevar available.

Can I transfer my old Google Analytics data to GA4?

No. A new GA4 setup requires creating a new property and tracking ID.

Why should I use GA4?

It's risky to ignore how Google invests in their products. You don't want to be left behind if they decommission their old products. Adapt or die. They are also touting machine learning features to help identify insights like customer churn that will only be available with GA4.

What should I do?

It seems that Google will continue to invest in GA4 and it's not clear if the existing GA will be decommissioned in the future. But if you decide to move to GA4 you won't be able to move old data into the new property - so my recommendation is to try and get the best of both worlds:

  1. continue taking advantage of Shopify's powerful Enhanced Ecommerce integration with standard UA Google Analytics.
    • The UA tag should not be in your theme files. Shopify adds this tracking automatically.
  2. Set up GA4 and start collecting data into this new property so if and when it becomes your primary dashboard you have historical data.
    • The G-1234 tracking code will need to be added to your theme files. The best place for it is usually in layout/theme.liquid

What people are saying:

Additional Reference