Google Analytics 4 and Universal Analytics theme integration

Hello

I am writing to inquire about Google Analytics integration on my website.

I currently have both the Universal Analytics and Google Analytics 4.

On Shopify I have both the Google channel - with the UA and GA4 tracking codes activated - and the code scripts inserted in the theme.liquid file.

Now, I am not sure if I have to remove the UA and GA4 code scripts from the theme.liquid file or keep them on.

Any help would be highly appreciated.

2 Likes

Hello @Quondy ,

Greetings! I am Gina from the flareAI app helping Shopify merchants get $5Million+ in sales from Google Search, on autopilot.

It’s great to hear that you are using both Universal Analytics and Google Analytics 4 to track your Shopify website.

Regarding your question, it’s not necessary to remove the Google Analytics tracking codes from the theme.liquid file if you have already set up the Google channel in Shopify with both Universal Analytics and GA4 tracking codes activated. The Google channel will automatically track your website traffic and e-commerce data, and you can view the data in your Google Analytics account.

However, it’s important to ensure that the tracking codes in your theme.liquid file matches the codes in your Google channel settings. If they don’t match, it could lead to discrepancies in your data.

To verify that your tracking codes are correct, follow these steps:

  1. Log in to your Shopify admin panel and go to the Sales Channels > Google channel section.

  2. Check that both Universal Analytics and GA4 tracking codes are activated and that the tracking IDs match the codes in your Google Analytics account.

  3. Go to your Google Analytics account and check that your website is properly tracking data in both Universal Analytics and GA4.

  4. Check that your tracking codes in the theme.liquid file match the tracking codes in your Google channel settings.

If everything matches up, then you should be tracking your website data accurately, and you can leave the tracking codes in the theme.liquid file as they are.

Hope this is helpful

Gina

Hello @flareAI thank you for taking the time to reply to my question.

I was asking this as when I do run the Page Speed test the main issue is the the unused Javascript code, where UA and GA4 appear twice. Please see screenshot here below