Both Shopify Google Analytics 4 & GTM tag setup on Shopify store

Both Shopify Google Analytics 4 & GTM tag setup on Shopify store

NolkOS
Visitor
3 0 4

If we setup both Shopify Google Analytics 4 & GTM on Shopify stores, will traffic (sessions) be duplicated counts?
1. I have GTM tag to setup to track traffic & event on Shopify (theme.liquid) - All good.
2. Shopify have function to connect Google Analytics 4, so it will help us alot if we update theme and lost GTM tag script.

So can we setup both GTM tag on theme + Shopify Google Analytics 4? Will it counted duplicate sessions? What is best practice here?

Thanks.

Replies 4 (4)

flareAI
Shopify Partner
2405 224 546

Hello @NolkOS,

 

I am Gina from the flareAI app helping Shopify merchants get $6Million+ in sales from Google Search, on autopilot. Hope you are having a good day.


If you set up both a Google Tag Manager (GTM) tag on your theme and Shopify's Google Analytics 4 (GA4) tracking, it can potentially result in duplicate sessions being counted.


GTM Tag
When you install GTM on your theme, it allows you to add various tracking tags, including GA4. If you've already configured GA4 within GTM, this means that GTM is sending pageview and event data to GA4 directly.

 

Shopify GA4 Tracking
Shopify provides built-in integration with GA4, allowing you to enable GA4 tracking by simply entering your GA4 tracking ID in the Shopify admin. When enabled, Shopify will automatically send relevant data to GA4, such as pageviews, transactions, and events.


If you have both the GTM tag and Shopify's GA4 tracking enabled simultaneously, both mechanisms will be sending data to GA4, potentially leading to duplicate sessions being counted. For example, a single pageview could be recorded twice—once through GTM and once through Shopify's tracking.


The best practice here is, you should choose one method for tracking GA4 data consistently. 


1. GTM Only
If you've set up GA4 tracking within GTM, you can disable the built-in GA4 tracking in Shopify. Go to your Shopify admin, navigate to "Settings" > "Online Store" > "Preferences," and remove the GA4 tracking ID. This way, you'll rely solely on the GTM tag to send data to GA4.

2. Shopify GA4 Only
If you prefer to use Shopify's built-in GA4 tracking, you should remove the GTM tag from your theme. You can do this by removing the GTM code snippet or any references to GTM in your theme's code.


By choosing one method and ensuring only one tracking mechanism is active, you can prevent duplicate session counting and maintain accurate analytics data in your GA4 reports.


Hope this helps


Gina

flareAI : Get Sales from Google Search, on Autopilot
$10+ billion in eCommerce on Google Search, every day. Find out how much you are missing
Ipe
Shopify Partner
1 0 0

Hi,

 

Will all GA4 data not be visible in Shopify if you stop using the native GA4 integration and start collecting GA4 data via GTM?  

Josh_Uebergang
Shopify Partner
1024 44 278

Yes, you can set up both. However, I don't know why you would duplicate a set up.

 

Decide on your goal for doing so. If Shopify's native GA4 is your primary set up, then the most common goal is get custom events, or send other supplementary data not supported in Shopify's set up. That makes sense to set up both.

 

If you have any duplicating events, like page views, then send a non-interaction hit of true to avoid duplicate data that you're worried about.

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

Hi Josh,

 

I would like to keep Shopify's GA4 integration as I have experienced discrepancies when setting it up with GTM. However, there are custom events I want to send to GA4 through GTM, how have you gone about setting up the GA4 configuration tag that does not send page views to GA4?