Here is a native solution from Google on how to install Google Analytics 4 in Shopify.
Requirements
- Access to Google Analytics (admin)
- Access to Shopify > Settings > Customer Event
Get Your GA4 Code
First lets find your Google Analytics Measurement ID by going to:
- Google Analytics
- Cog Icon (admin)
- Under Data collection and modification, choose Data Streams
- Click on your data stream
- Now you can view and copy your measurement id

Now go to Shopify > Settings > Customer Events
And click on Add custom pixel

You can give it any pixel name, but I will call it Google Analytics. Now click on Add pixel.

Get the code:https://merchantcodex.com/google-analytics-4-code-for-shopify-pixels/
The code below is developed by Google, now replace the tagId value with your measurement id.
Now paste your code in the custom even code section.
Set your permission to Analytics
Set your data sale to Data collected does not qualify as data sale


Is it possible to use it without installing Google Sales channel? I have placed the script but no events are being recorded.
Make sure to wait 2 days, and also make sure you have added your measurement ID.
Hi Emmanuel, still no events are being recorded after 2 days and with the correct Measurement ID. Please note that we have not connected Google Sales Channel and using Shopify’s default Cookie Consent Banner.
If it doesn’t work, that means something is blocking your setup. Maybe it’s an app, maybe you didn’t publish your theme for the checkout.
It works now, seems that it needed a little bit more of 48 hours! Thanks!
Glad it all worked out.
Hey,
Can Shopify Basic use GTM?
Why the official document said only Shopify Plus can use GTM?
Yes you can install GTM, just not the checkout, for that you need checkout.liquid in your theme.
Hi.
I have followed this https://feedarmy.com/kb/adding-adwords-conversion-tracking-to-shopify/ articles of yours.
The conversions are google ads are visible.
The conversions are visible in UA.
But GA4 is not working… I even talked to a google sepcialist and he check that UA and GA4 is connected…but its not working.. so
if i follow this article about gtm conversions.. and do it.. will this mess us my convesrions to google ads.. I mead i have that long code in the shopify check out
If i use gtm based on this article.. i should delete everything else about ga4? from the theme.liquid and the checkout script?
Thank you
Szandra
To add eCommerce data for Shopify in Google Analytics 4, I recommend using the Google Shopping & Youtube App, which you can find in the Shopify app marketplace.
Hi, it says “This installation is possible for all Shopify subscription plans.”
However Checkout.liquid is only available to Shopify Plus accounts?
Do non Shopify Plus users just skip this step?
Hello Stephen, that is correct.
Thanks!
There is no checkout liquid in my shopify store, what should I do?
If you want checkout.liquid, you need to contact Shopify to add it.
Hello, I have pasted the global site tag in the theme of shopify, but there is no conversion tracking event (checkout) in GA4, and I also set up ads enhanced conversion, what should I do? thank you very much
I recommend installing Google Ads conversion action instead: https://feedarmy.com/kb/adding-adwords-conversion-tracking-to-shopify/
By Doing this will conversions record in google ads or i have to do something else?
This is a tutorial to install Google Analytics 4 and also to resolve the global site tag, not conversion tracking directly. If you want to install conversion tracking and want to also include enhanced conversions, follow this guide: https://feedarmy.com/kb/adding-adwords-conversion-tracking-to-shopify/
Thank You! – So detailed & easy to follow. For someone non technical it is Impossible! to figure this out on mu own – Much Appreciated 🙂
Pleasure! 🙂
How long does it usually take for Google ads to recognise the changes made? I changed as per your instructions yesterday, however it is still showing the ‘Make sure that you don’t miss any conversions by fixing your global site tag issues ‘ – Thanks!
If you have an issue with misconfiguration on your shopping campaign, this is related to conversion tracking and remarketing. Not GA4.
Hi Emmanuel – the error I got was “Fix your global site tag issues” followed by “Over 10% of your pages do not have gtag.js or a Google Tag Manager tag” – I googled it and came across your article that I implemented – so it wasn’t the correct solution? thanks
This tutorial will indeed resolve the Global Tag issue. But as if you are tracking conversion using Google Ads natively, then there will be no lost conversions. Unless you can not track enhanced conversions. If you also like to enable that, here is the guide: https://feedarmy.com/kb/adding-adwords-conversion-tracking-to-shopify/
Thank you! Appreciate it – my Google ads are still showing the fix your global tag issue it’s been 3 days – so does it take a few days for Google to update and recognise the steps taken . Thanks
If you are referring to recommendations in Google Ads. Sometimes, it does not disappear. And you will need to manually dismiss and flag it as already done outside the recommendations. If you mean in the audience manager, this can take a while. As long as it is installed you can ignore the warning.
Hi there! Just want to confirm if this method of installing the GA4 in Shopify allows you to track the conversions in Analytics. The other methods I see only requires installing the code in the themes, but this doesn’t allow you to track conversions.
Yes, you can if you set it up. However, if you want to track conversions, I recommend setting up with enhanced listings here: https://feedarmy.com/kb/adding-adwords-conversion-tracking-to-shopify/