🔴 How to Install Google Analytics 4 on Your Website

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video i'm going to show you how you can install the new google analytics form onto your website all and more coming up there measure geeks julian here back with another video today we're going to learn how we can install the new google analytics 4 onto your website so without further ado let's dive in right into our little demo here so here i'm on my demo shop and i don't really have anything installed as you can see in my google tag assistant we should add google analytics so should we go through this so in order to start this project you obviously need to go over to google to analytics.google.com if you don't have an account you need a google account to sign up and then you are greeted with a little bit of this screen if you already have a google analytics account we won't be upgrading anything we're just going to start out from scratch here so you can start building your account first of all you need your google analytics account these are usually your account details such as your company so let's say my company is called demo company and then you have some provisions here for data sharing to google you can choose to support google with this information or not i'm just gonna click next here and then you give a property name and this is normally your website so i'm just gonna go with demoshop.com don't forget to choose the right reporting time zone this can be crucial you want to choose a time zone that is where your server is or where your clients are mostly located and google analytics will calculate certain things based on the time zone so you should choose the right one and then the currency i usually use use us dollars and then we click oh then we can choose to look at the advanced options and here is a little setting if you want to go back to the old google analytics to universal analytics and want to start a property in that realm you can do so still by clicking here this button and it will create a universal analytics property i would actually say if you don't have universal analytics installed yet you should have this first at least in this beginning stages because google analytics is still google analytics 4 is still quite new let's go next here and choose well there's some information some business information that you can also choose to create you have some terms of service that you need to accept and we should be off to the races next step is to actually send data to our google analytics and you have with google analytics for different opportunities to do so with an ios app and android app but also with web and we're gonna obviously go with web right here because we want to track our website and then we can choose our domain and give this stream a name could call it website or demo shop something else then we get to the point of enhanced measurement now when we install google analytics google analytics can track automatically for us things like page views scrolls outbound link clicks and site search video engagement and file downloads now this is new in google analytics for you can activate this but you could also say i don't want any of these checked we're just gonna go with the default here and create this stream the next part is our okay i have never seen this before i don't have a measurement id here let me see if no it's funny so it didn't give me a measurement id never seen this before this is still quite new the system so let me [Music] go to data streams again here and look at my data stream and it says no doesn't give me a measurement id well let me reload this whole analytics thing and there's where my little live demo here because we are live falls apart maybe because we don't get a measurement id yes now we get our measurement id and with this measurement id we are able to plug that into our website in order to track it now there are different methods of installing this measurement id and this measurement code so we have tagging instructions down here and depending on your case you might want to use one or the other i prefer google tag manager but for those of you who just want to install google analytics without any other functionality of any other tags like the facebook pixel and so on you might want to also look at the global site tag this is a global script that you would normally give over to your developer to install in the head section of your website to try this out let's copy this code and go into our website which is here i have a wordpress blog running now obviously if you don't have a wordpress blog that is not going to work but in your website you normally have access to some kind of code the underlying code that is deployed on your website and we and wordpress can go into appearance here and then in the theme editor and then i would recommend that you choose your child's theme so if you don't have a child theme in wordpress at least then create one then you can go to the header php now this might be also different from your theme that you have running but for me it works quite well i can place this here under the meta information let's put our code right here then we can update our file and this should now be successfully installed let's go back to our page and reload that and we should see inside of our tag assistant this is a little extension that you can install for chrome we have the global site tag now installed with g eq and so on so this is should be installed correctly and in google analytics we might not see something right away let's see if we reload this no information quite yet let's go into our reporting and we obviously have the ability to go into the real-time reporting this is where you could see something but we also have the ability to go into our debug view so here we would see in real time the hits that get sent over and what can happen on the page itself as well is that or this new technology of ga4 batches hits so sometimes they don't get sent right away it takes a moment to gather all the hits together and then send them on so here right now seems like it's not yet working as expected don't get any data sometimes you need to put your website into a special mode and for that you can either use another extension called a ga debugger you could also do it inside of the tag assistant there's also a functionality called ga debug you can turn this on and now let's see let me open up the developer tools nope i don't get any information okay let's use the ga debugger another extension this will log some information about what was sent over to google analytics inside of our javascript developer console and that way we'll be able to see what gets sent over that seems to work and once you install this gi debugger and activate the debug mode it should automatically put our tag or our google analytics into this mode and we still don't see anything so here we go um this is the crux of a live demo i wouldn't say that this is normal but at the same time it can take some while till google analytics instance is ready to receive data so i wouldn't sweat it and maybe come back in a few hours when we look at our installation here and attack assistant it seems like google analytics is correctly installed invalid or missing account id non-standard implementation okay go back to the admin here we have installed our tag let's see here ah we now need to connect our side tags so you need to still connect your tag to your no we have our tag connector that should be properly connected let me take my measurement id here okay so one is now connected let's reload this let's reload this nope let's go into the debug new also no data so i'm just looking in the chat here and valdemar says that it takes a long time to load and install it on the website only 24 hours later they appeared so yeah that was my fear that this live demo wouldn't actually work in that sense let me see what the tag assistant now says it just gives me these errors that don't mean much i would say that it's now installed correctly but who knows yeah we have one viewer and a debug view still shows nothing real-time view yeah we have one person from berlin that's me so i'm not sure why the debug view doesn't show my information but apparently now it's tracking correctly and when we go from page to page we hopefully would see you can actually go to view user snapshot and since there's only one user on the page that's me we would see all the interactions that get sent over so we have a page view here you can look at the events that get sent over and for example the properties like which page we are currently on well this is the page view from before and again this view might not always reflect exactly what is happening right now because these hits are batched and it might take some time for the system to cut it up when the hits get sent so let me just see here if you can generate a bit more hits no it doesn't want it to happen okay takes a while and that's something we would need to get used to when we were working with ga ga4 that won't be able to exactly see what is happening in the moment at this time so this is the first method of installing google analytics and you could be set here already and have it installed on your website which in this case is a wordpress website now obviously i prefer the second way of doing things which was google tag manager so how do you do this with google tag manager let's go back into data streams here and actually use our measurement id again to this time use google tag manager to deploy this tag so for now i'm going to go back into my backend and delete our global site tag that we had installed here on the header php oops right here is that all no that's all let's save this and obviously right now we won't be seeing any google analytics being installed so instead we want to do this with google tag manager if you are not yet familiar with google tag manager it's a tool to deploy multiple of tags or marketing tags like these little javascript codes onto your page with a visual interface like we have right here and it is quite useful when it comes to tracking customization so if you want to do anything specific fire certain tags on certain pages google tag manager is the way to go especially if you have multiple of these marketing tags like from facebook adwords google analytics or other vendors that are out there all you need to do is install on your page a little script code one time and the head and the body section so we're gonna go ahead and just swap this out what we had before this goes beneath the opening body tag let's save this and on our page you should now see that we have google tag manager installed now nothing happens right now because google tag manager is not a tracking tool it's a tag management tool and there we can now deploy our tools through that system so for google analytics we can simply go to our tags here or new tag and under the tag configurations we have all these different templates for these different vendors available there's also one for google analytics four and the first stack that we want to install is the google analytics for configuration so click here and then we all we need to do is enter our measurement id well that didn't copy let's go back here get the measurement id put it into our field and then we can choose to send over a page you already because this is actually a configuration tag it combines all the configurations that you might want to do to your google analytics for at least on the measurement side and ports them over to all the tags that come afterwards so here we can say where we store our measurement id and we want to also send over page 2 information this is really all that you need to do in order to replicate the functionality that we had before inside of ga 4 with the global scitec so i'm going to give this a name and we're going to try this on page view and then the trigger is going to be our standard trigger that we have always available it's all pages because then google analytics will be installed on all the pages of our website where we at least have this google tag manager code installed which should be all the front-facing pages of our website okay now that we have this installed we can actually try it out and this is another big advantage of google tag manager we can go into the preview mode which will put our browser and only our browser into a special mode we need to connect this preview mode to our website and then the tags that are inside of google tag manager will be deployed only on our browser you can see that the debugger is now connected and when we go back to this tab here we see that it's connected and all the things that are happening in the background of google tag manager one thing that we saw or that we can see here is that on the container loaded event our ga4 config tag fired and should be sending data over to google analytics we can also see inside of our tag assistant here yep that should have fired our global scitec i'm not sure why this is showing twice it's probably just a mistake inside of the tag assistant and data should be going over to google analytics let's see again inside of our debug view nothing here real time here we go we have a person that would be me and was the last event time is now no that cannot be it let's click around a little bit more on the website itself and hope that it will dispatch some of these hits that gets sent in batch sometimes nothing just yet yeah one user ah here we go there was another interaction now it doesn't want to give me that data here it says there's one user one minute ago this is the page am i on this page right now no yeah this doesn't make for a very good episode um but at least you can see that these are the troubles that you sometimes run into i would say that google analytics as google analytics 4 as a new system isn't quite as responsive as we are used to it from universal analytics quite yet so we might need to wait for some data to come in and see if we can see any kind of activity in the system to make sure it actually works now there is a little ah here's a page view that came in is that me let's see page location yes that is me so we can see that it's installed correctly and sending data over so with that in mind we can now confirm okay this was sent over by the way you have the ability in this tag assistant preview mode to also see what has been dispatched as a hit to google analytics and it says here no hits were dispatched which is hard to believe because we have data that got sent over okay yeah there's always sometimes a bit of a mystery around the debugging still that we all need to be aware of when working with google analytics for so not as straightforward as you can see you uh tell you in this demo to install google analytics for but as we have seen in some instances there's data being sent over that would tell me that the tracking code is correctly installed and it's now tracking data for us and this this data that we've seen before inside of our debug mode here but also when we have it now on multiple users so if i set this live it should show me more data in order to do so you can go ahead and let's disconnect our debug mode here and go back to our page of our google tag manager and then we can submit this as a version because what we have implemented inside of google tag manager is not yet live on the website so not all the users would have this or not any of the users would have these changes applied live to the website which is a security feature as well as a best practice from web development to actually keep a keep track of a version so you can go back in time if something goes wrong in your tracking deployment so we can go ahead and submit this now as a version give this a name and then we are ready to publish this and now any user that would go to the demo shop would be tracked by google analytics for all right so this video was a little bit longer than i expected but this is how it goes with live demos um if you like this video then please give us a thumbs up and also subscribe to the channel right over there because we bring you new videos just like this one every week now my name is julian til next time
Info
Channel: MeasureSchool
Views: 3,324
Rating: 4.9304347 out of 5
Keywords:
Id: jS8rAkvHkco
Channel Id: undefined
Length: 22min 28sec (1348 seconds)
Published: Fri Nov 13 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.