Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am trying to edit the code for my store to add Google Analytics, which requires a global site tag. I can get to the "edit code" area through the "Actions" tab, but now I have a list of pages, none of which I recognize. How do I determine where to put the tag?
Solved! Go to the solution
This is an accepted solution.
Hi Jpshivell,
there is a much easier wait to install you Google UA global Tag in a Shopify store, rather then editing the code.
I assume you have already your UA HTML code copied: simply go to Sales Channels/Online Store/Preferences and scroll down till the section Google Analytics. There you can paste your HTML code and name the property in the title. Activate also "advanced eComemrce" for more detailed demographics data collection and you are done! Shopify inserts in all the website pages your UA global Tag. I hope this helps, take care!
This is an accepted solution.
Hi Jpshivell,
there is a much easier wait to install you Google UA global Tag in a Shopify store, rather then editing the code.
I assume you have already your UA HTML code copied: simply go to Sales Channels/Online Store/Preferences and scroll down till the section Google Analytics. There you can paste your HTML code and name the property in the title. Activate also "advanced eComemrce" for more detailed demographics data collection and you are done! Shopify inserts in all the website pages your UA global Tag. I hope this helps, take care!
I tried your solution, but I keep getting an error, possibly because I copied and pasted the wrong code. This is the code I pasted into the form:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6LLQ99XZVK"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-6LLQ99XZVK');
</script>
When I paste the code, I get the following error message: Analytics snippet does not look valid (UA-xxxx-x)
The reason I think I have the wrong code is because I do not see a "UA" anywhere. So, where do I get the proper code?
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024