Should I manually insert GTAG. in theme.liquid after setting GA4 in Google Channel?

Solved

Should I manually insert GTAG. in theme.liquid after setting GA4 in Google Channel?

Lovinflame
Excursionist
40 0 22

Hi, 

 

Recently I finished GA4 setting in Shopify's Google Channel.

I can see it said "Your site data is being shared with Google Analytics." and I'm also receiving data on GA side.

However, I wonder do I still need to insert GTAG manually in the theme.liquid?

Looking forward to any suggestions, really appreciated!

Accepted Solution (1)

PageFly-Richard
Shopify Partner
4593 1052 1714

This is an accepted solution.

Hi @Lovinflame

 

This is Richard from PageFly - Shopify Page Builder App

 

For your case, I suggest there's no need to add the GTAG to the theme.liquid file. Furthermore, if you want to quickly and easily update tags on your website or mobile app from a web interface, you can use Google Tag Manager (it performs similar functions as GTAG) instead. This method is also recommended by Google. 

 

Feel free to ask me if you have any questions. 

 

Good luck and have a nice day!

 

Best regards,

Richard | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


All features are available from Free plan. Live Chat Support is available 24/7.

View solution in original post

Replies 6 (6)

PageFly-Richard
Shopify Partner
4593 1052 1714

This is an accepted solution.

Hi @Lovinflame

 

This is Richard from PageFly - Shopify Page Builder App

 

For your case, I suggest there's no need to add the GTAG to the theme.liquid file. Furthermore, if you want to quickly and easily update tags on your website or mobile app from a web interface, you can use Google Tag Manager (it performs similar functions as GTAG) instead. This method is also recommended by Google. 

 

Feel free to ask me if you have any questions. 

 

Good luck and have a nice day!

 

Best regards,

Richard | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


All features are available from Free plan. Live Chat Support is available 24/7.

Lovinflame
Excursionist
40 0 22

Hi Richard,

 

Thanks for your reply! I'm also user of Pafegfly, and I saw there's a theme.pagefly.liquid in my layout. I don't need to do anything here for google analytics, right?

 

And for your advice on GTM, since I'm not using an advanced plan  (which means I can't install GTM on checkout). Do you still think GTM is a better solution for me?

 

Looking forward to your reply soon, thanks!

PageFly-Richard
Shopify Partner
4593 1052 1714

Hi @Lovinflame

 

Here are my answers to your questions:

 

1. Yes, indeed. There’s no need to edit that file for the Google Analytics

 

2. Since the Google tag doesn't replace Google Analytics but enhances the process of how you work with Google Analytics. You can choose whether or not to add it to your theme.liquid file. Because GTM is for Shopify Plus plan, so I suggest the proper option here is to use the gtag.json file. 

 

I hope this help. Feel free to contact me if you still have concerns.

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


All features are available from Free plan. Live Chat Support is available 24/7.

sampymishra
Shopify Partner
296 10 36

Hi @Lovinflame 

 

If you have set up GA4 integration in Shopify's Google Channel, you don't need to manually insert the GTAG code in your theme.liquid file as it is automatically added to your website's pages.

 

You can verify that the GA4 tracking code is present on your website by viewing the source code of your website's pages and looking for the "gtag.js" script.

 

Hope this helps.

Sampy Mishra | Customer Success Manager @ AdNabu

 - Was my reply helpful? Click Like to let me know! 

 - Was your question answered? Mark it as an Accepted Solution

 - Try our Nabu for Google Shopping Feed from Shopify App Store. 

flareAI
Shopify Partner
2405 224 543

Hello @Lovinflame,


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


If you have already set up GA4 in Shopify's Google Channel and can see that data is being shared with Google Analytics, you do not need to insert the GTAG manually in the theme.liquid file.


The GA4 integration in Shopify's Google Channel should automatically add the required tracking code to your store's pages. This means that you should be able to track your store's data in Google Analytics without having to manually insert any tracking code.


However, if you have previously inserted the GTAG manually in the theme.liquid file, it is recommended that you remove it to avoid duplicate tracking and ensure that your tracking data is accurate.


To remove the GTAG code, you can simply delete it from the theme.liquid file or comment it out by wrapping it in <!-- and --> tags. Once you have removed the GTAG code, you should continue to receive data on GA side through the GA4 integration in Shopify's Google Channel.


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

Vranklin
Excursionist
22 0 4

I have installed GA4 through the Google Sales channel, however the sales tracked in GA are not accurate. For example it will say 5 sales on a day when in fact it was 6.

 

Is there anything I can do to make it more accurate? A better way of installation?