How to upgrade to Google Analytics 4?

Solved
Keegan_
Tourist
9 0 13

Hi everyone,

 

I've just heard about GA4 and it sounds good.

 

I've just created a new property, but wonder how I implement it in my Shopify store?

 

Or will the existing account connection provide the new tracking ID?

 

Thanks.

Accepted Solution (1)

Accepted Solutions
rsimmons
Tourist
3 1 2

This is an accepted solution.

@Josh_Uebergang what you say makes sense, but if analytics is using analytics.js and if we want adwords tracking on the site, that's using gtag.js, don't we have dual google implementations? and wouldn't that cause problems? see attached image

Screen Shot 2020-11-11 at 5.08.36 PM.png

We saw our bounce rate cut in half (suspiciously) and some GA events stop flowing in, which always leads me to believe there's a GA implementation problem. We cannot backtrack it to any changes we made on our site (non-plus). The events that ARE able to flow in are on the checkout pages, so I'm wondering if gtag.js is blocking them from getting tracked on the rest of the site (since gtag.js is not in our checkout, it's not blocking the events there?)

These errors we're experiencing just happen to coincide with the prevalence of GA4 and google pushing us to update, so it's all part of my investigation. 

 

View solution in original post

Replies 61 (61)
izzyqualls
Tourist
3 0 25

I am also trying to implement Google Analytics 4 on my store. Since I don't have Shopify Plus I can't edit checkout.liquid, so ideally we would have an update to the integrated Google Analytics feature in Online Store Preferences.

vschantz
Tourist
3 0 10

I contacted Shopify support a few days ago and am still waiting on a response. Ideally they would have rolled an integration out in tandem with GA4 -- especially since we're in Q4 now. 

Keegan_
Tourist
9 0 13
I hoped maybe they had done that - and because of the account level
integration, no changes would be necessary by admins.

Kind of expected Shopify would be a launch partner for a big revision of GA.
ianb
Tourist
4 0 2

Following. Wondering this myself.

Synflex
Tourist
3 0 7

Implementing GA4 is quite simple - just copy the GA4 tracking code into theme.liquid right after the <head> tag. That's it.

Keegan_
Tourist
9 0 13
I would have to pay more to edit my theme code.
Synflex
Tourist
3 0 7

You just need to add a couple of lines to the theme.liquid file. You can do it just fine on your own in one minutes.

Keegan_
Tourist
9 0 13
Sorry, I was unclear. I have an old Shopify plan where I pay less per month
but can't edit the theme. I'd have to upgrade my account permanently in
order to manually install GA4.

I'm going Shopify will support GA4 in time for the holiday season.
izzyqualls
Tourist
3 0 25

If you don't have Shopify Plus you can't edit checkout.liquid, meaning you can't track cart conversion statistics. That's why Shopify offers an integrated solution. But they haven't updated it in a long time it would seem. It's possible to fire the GA4 tag by adding it in the Additional Lines of Code under Google Analytics Settings in Online Store Preferences, but you can't take advantage of enhanced ecommerce tracking.

Keegan_
Tourist
9 0 13
Right, that's exactly what I was thinking, but was hoping someone could
confirm.

C'mon Shopify. Surely your many thousands of paying users should get GA4?

Could someone from Shopify perhaps give us a timeline, so we know what
to expect?

Thanks.
vschantz
Tourist
3 0 10

I agree that the basic implementation is easy, but the features of enhanced e-commerce are now obsolete. They changed how their events are named. In order to have enhanced e-commerce data with GA4 you need to update the data layer with all of the new events. 

 

What I'm hoping for is a Shopify update to have this done automatically like their current enhanced e-commerce option. 

andrew_ecomloop
Shopify Partner
46 1 13

Google [provides instructions](https://support.google.com/analytics/answer/9744165?hl=en&utm_id=ad) for both upgrading existing GA accounts and configuring new accounts for Google Analytics v 4. The wizard _cannot_ transfer data using existing tags from Shopify due to the existing Shopify/GA configuration.

After upgrading to GA 4, a new tag must be installed manually in the Shopify theme. This tag includes the Measurement ID and is similar to the Tracking ID. It should look similar to this and should be pasted just before the </head> closing tag, generally in the theme.js file:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-MEASUREMENT-ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-MEASUREMENT-ID');
</script>

 

After installing, go to the site to check that it's installed. Google Analytics should pickup the tag event quickly in the Realtime section. No ecommerce transaction data available yet. 

ecomloop
We help uncommon businesses succeed in the digital economy
Have an interesting project? Send a message or visit ecomloop.com
Keegan_
Tourist
9 0 13

Thanks for the response, but I don't have the option to edit my theme. 😞

andrew_ecomloop
Shopify Partner
46 1 13
I wasn't aware there's a Shopify plan that restricts access to the theme
editor. What plan is that?
ecomloop
We help uncommon businesses succeed in the digital economy
Have an interesting project? Send a message or visit ecomloop.com
Keegan_
Tourist
9 0 13
It's an old plan, I was grandfathered in with many others.
Josh_Uebergang
Shopify Expert
853 30 214

I have not done a full Analytics 4 setup yet, but reading Google's docs, Shopify's universal analytics should function just fine with it. According to Google's upgrade guide:

Now that you have set up your Google Analytics 4 property, you need to tag your site (with the global site tag, gtag.js). You won't replace the tagging that already exists for your Universal Analytics property, instead you'll add to it. So, data will flow to both your Universal Analytics property and your Google Analytics 4 property.



Note that Shopify uses analytics.js (not gtag.js for it's existing universal analytics property), so you can confirm the final steps to upgrade by following this: https://support.google.com/analytics/answer/9310895#analyticsjs

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
izzyqualls
Tourist
3 0 25

None of the solutions recommended by "Shopify Partners" are adequate. Shopify needs to upgrade the integrated Google Analytics module. I know how to paste the tracking snippet into theme.liquid. That is wholly insufficient. And I'm not going to upgrade to Shopify Plus just so I can edit checkout.liquid. Shopify is an ecommerce platform. What good are analytics without ecommerce data? I don't care who comes to my website, I care who converts. 

ExceptionalTeam
New Member
1 0 9

Shopify Ecommerce tracking is based on analytics.js Enhanced Ecommerce and is passed into Google Analytics web property via native Shopify integration. 

GA4 Ecommerce tracking is a completely different library, and I don't think it would work with the existing integration Shopify has. 

Very surprised that Shopify didn't at least come out with a statement informing their community that they are working on this issue... 

Keegan_
Tourist
9 0 13

Yeah, I was hoping someone from Shopify would just let us know when GA4 will be fully supported.