BACK

how to add a tracking tag to shopify for google analytics

Google Analytics (GA4) Ecommerce Tracking For Shopify this is an extremely valuable video if,you hav

ZoCo Marketing

Updated on Mar 30,2023

Google Analytics (GA4) Ecommerce Tracking For Shopify

The above is a brief introduction to how to add a tracking tag to shopify for google analytics

Let's move on to the first section of how to add a tracking tag to shopify for google analytics

Let TThunt's experts help you find the best TikTok product on your Shopify business!

Find TikTok products (It's Free)
No difficulty
No complicated process
Find winning products
3.5K Ratings

WHY YOU SHOULD CHOOSE TTHUNT

TThunt has the world's largest selection of TikTok products to choose from, and each product has a large number of advertising materials, so you can choose advertising materials for TikTok ads or Facebook ads without any hassle.

how to add a tracking tag to shopify for google analytics catalogs

Google Analytics (GA4) Ecommerce Tracking For Shopify

this is an extremely valuable video if,you have a shopify store in today's,video i'm going to be showing you how to,track revenue from your shopify store,into google analytics 4. previously this,was a very difficult task to do if not,impossible and i've had a lot of people,message me and ask me how can i track,revenue in google analytics four and,today i'm going to be showing you,exactly that step by step at the end i,will even be showing you how to set up,conversion tracking in your google ads,account so take this revenue tracking in,google analytics for connect it to your,google ads account and import those,conversions as well now before we jump,in on how to do this i do have a few,important notes shopify still does not,have a direct integration with google,analytics for as a result today i'm,going to be showing you how to track,revenue using google tag manager now,don't let that scare you if you're new,to google tag manager i'm going to show,you step by step on how to set that up,and even for people that have google tag,manager currently on their website i,encourage you to watch this video all,the way through because there are some,things that you might need to change in,your google tag manager setup in order,to track the revenue but i am so excited,to share this video because this is one,that i know a lot of people have been,waiting for for a long time so let's,jump in so the first thing is to make,sure you have a google tag manager,account if you don't quickly google it,and uh create a new account your view,may look slightly different when you're,creating account because it's a brand,new container for you but hit create new,account from there all you need to do is,name your website and then go through,and name your container as well and then,for most people you're going to want to,click this web property i assume because,you're on a website from there you can,hit create and then it will drop you,into your google tag manager account,we're going to be in the left-hand side,working in the tags area as you can see,here we're going to be creating a new,tag for google analytics for we're going,to be deploying google analytics for,through google tag manager so we're,going to go through and do that real,quick so that google analytics is firing,on all the pages of our website so you,go through and name this google ga4,config is what i typically like to name,this but you can name it whatever you,would like and then we're going to click,tag configuration and the tag,configuration that we want to choose,here is the ga4 configuration as you see,there from here you're going to go and,copy your,stream id from google analytics for this,is assuming that you already have a,google analytics for account if you,don't know how to get this code go to,the admin there and then go to data,streams click on that and then you will,see your measurement id where you can,copy that and then go over to backtick,tag manager paste that inside of there,and then we want to then add a trigger,and you want this to fire on all pages,of your website because we want to track,all the pages for google analytics for,once that's done you can go through and,preview if you like but for this one,we're just going to go through and,publish it give it a name convention i,just named it the exact same tag that i,just published so ga4 config,i'm having a little bit of trouble there,and then hit publish so now we have,google analytics for deployed through,google tag manager but we need to make,sure that google tag manager is firing,on our shopify store so if you click,that code in the top right hand corner,it'll bring up a view that looks like,this you want to copy the head and then,head over to your shopify store and then,we want to go into the theme liquid or,into edit code and then into the,theme.liquid and we're going to be,pasting this code in the head of your,website so just go and find that head,tag go right below it and then copy that,in there and then there is another thing,that we need to do for this setup this,is a really important spot i will link,this down below but you want to go and,copy this code right here and put this,right before where you put your google,tag manager code as well so this is an,important step like i said i'll link,i'll add a link to this google tag or to,the google,steps on how to do this but copy that,inside of there as well and then we want,to go back over to google tag manager,and grab the body tag and do the same,thing scroll down until you find the,beginning of that body tag there and,then paste it right below now before you,hit save if you previously have added,google analytics for manually through,the theme.liquid using this code right,here then you're going to want to go,through and delete that so i encourage,everybody to do a quick check of that,code i like to do a command find of just,the js tag if you find it inside of,there delete that entire code that you,just saw on the page so to make sure,that you're not double tracking events,in google analytics for now that we have,google tag manager installed on our,shopify website it's now go time to go,through and build the event to actually,track the revenue so we're going to,click on tags there and then we're going,to go up and we're going to hit new tag,i'm going to name this ecom you know ga4,ecom event whatever you'd like to name,it inside of there we're then going to,click on tag configuration and then we,want this ga4 event tag from here if you,follow the instructions up to this point,you'll see something that says ga4,config or whatever you named it in this,left-hand column right there and then,the event name you can go through and,manually add this to say like purchase,or something but for this it's going to,be better to track this as a dynamic,event inside of here so we're gonna,click on this little plus button and,then we want this to be an event next,we're gonna go over here to this more,settings button and you're gonna want to,check the send ecom data and then into,the data layer,we're then going to go through and click,triggers here and then we want to create,a new custom trigger so hit the plus,button in the top right hand corner from,there we're going to go through and do,tag configuration and we want this to be,a custom event and then from here i have,a code down in the description below,you're going to want to copy this inside,of here this is going to copy all of the,events that i think are the most,valuable for,tracking shopify purchases and it's in a,regular expression so you're going to,want to go through and click that little,button there on the right hand that says,time or use regex expression,from there we can go through and save,this event,and you need oh i forgot to name this,real quick,so we'll go through and name this,trigger,and i just like to call this ga money,sign ga4 you know ecom event whatever,you'd like it to be so that you know,what it is inside of your google tag,manager hit save,and then save one more time,and then from this point you can go,through and preview the changes inside,of google tag manager if you'd like but,i'm just going to actually hit submit,the changes so that i can see these,changes actually go live inside of,google analytics for if you just do the,preview mode you're not going to see,things go live inside of google,analytics 4. so go through and name the,version here and i'm just going to name,this ga4 ecom events publish that tag,and then there we have it there's our,changes exit out and then go back,and then from here i'm going to go,through and preview the changes and go,through and add your ecommerce store,inside of that button right there it's,going to connect google tag manager and,your ecommerce store so that you can go,through and troubleshoot events from,here we want to go through and send a,test purchase through so just grab,whatever product it is,and go through and do a test purchase so,for this one we're going to quickly go,through and grab,one of these products here and then i'm,going to run through the checkout,process real fast and because we're in,google tag manager preview mode google,tag manager is going to keep track of,all these events and basically this is a,way for us to test to make sure that,this purchase is actually firing and,going through the way that we want it to,so now we hit end the pay now and we're,about to hit the thank you page on our,shopify store once we've hit that page,we can then go back over into shopify,excuse me back over to tag manager and,we can see that our ga4 purchase did,fire underneath that purchase event and,we can even click inside of there see,the different tag details you can even,come over and click in this google,analytics view and see that the purchase,did fire and all the data that was,associated with that purchase there's,the purchase price or the revenue inside,of there and we can even go into our,google analytics and if you go into,configure and then debug view you can,then see inside of here your the the,debug view where you can see the,purchase if you click inside of that,purchase right there you can see all the,data associated with that you can see,here is the shipping cost the tax amount,which there wasn't any in this case the,uh the shipping we already saw that and,then the actual value which is what we,ultimately want inside of google,analytics right that's the purpose of,this video is to see that come through,what that allows you to do is to go into,different reports say we for instance we,come in here to that report right there,and then we go into monetization or even,you know ecom purchases or acquisition,you can see here the user acquisition,now you're starting to see um which,channels actually drove revenue you see,here's direct and organic and you can,see the amount of conversions or,purchases and then the total revenue,value this is the ultimate setup that,you want to have inside of google,analytics now i will say as you are,going through and testing this for the,very first time it did take a minute for,the revenue data to show up inside of,google analytics so give it a little bit,of time if you're not seeing it right,away if you saw it fire in google tag,manager that's probably a pretty good,sign but maybe wait a little bit to make,sure that you're seeing the revenue data,come inside of here just a quick note,and real quick for anybody that wants to,import this transaction gold now into,their google ads account and run it for,google ads essentially what you need to,do here is come down to admin and then,go down to google ads link go through,and link your account inside of here,we're going to choose a command i want,this one right here we're going to,confirm,and then do next and then we want to,enable these and hit next and then you,can hit submit,then allows us to have this linked,account so we can come over to our,google ads account go to tools and,settings we come to your to conversions,from here you can then go through and,add a new conversion action,and we want to choose import and then,google analytics for property and then,this is going to be from the web and,then continue,and then from here as you can see there,is our purchase event that we just went,through and created so we can select,that and import it into google ads so,now you have conversion tracking in your,google ads account from your shopify,store as well so you can optimize those,ads towards um your your shopping,campaign now if for whatever reason you,don't see that purchase event in google,ads right away give it a few hours and,then come back and check it later,sometimes it can take a little bit time,to go inside of there that's pretty much,everything if you made it this far in,the video i would appreciate it if you,would subscribe if you found value and,even like they're both free to do and it,helps a small youtuber out like myself,going forward when shopify does come out,with a direct integration to google,analytics for i will create a new video,on that so if you are watching this and,it's been a couple months since the,video came out be sure to check the,links down below to make sure that to,see if there's another way to implement,google analytics for but going forward,this will be a future-proof way to do,conversion tracking regardless but it,may be an easier way going forward

Congratulation! You bave finally finished reading how to add a tracking tag to shopify for google analytics and believe you bave enougb understending how to add a tracking tag to shopify for google analytics

Come on and read the rest of the article!

Browse More Content