foreign [Music] we're going to set up Google analytics for the very first time what we're going to do is create a brand new Google Analytics property a brand new website and then we're going to put the code on the website that we need to start sending events about what our users are doing on the site to Google analytics for processing we'll then jump into the UI for Google analytics and see some of the events and reports that we get right out of the box all right let's Dive In okay now we're on the home page of our Google analytics property now I've already created a Google analytics account and a Google analytics property and once you do that you're going to end up on a page that looks like this and it's going to be saying that hey we don't have any data right now you need to set up a data stream and all the data stream is as a source of data that we're going to feed into Google analytics for processing then Google analytics can use that data to provide us with reports which will in turn provide us with insights about what's happening on our website okay so there's a couple different type of streams that we can create we can create a web stream or an app stream and for the purposes of these videos we're going to focus solely on websites so all we have to do is go down here and click web and then we put in our web address so ga tutorials.com but you can use your website address and I'll call it GA tutorials website as my stream name so that's the source of data that's going to be provided for Google Analytics also notice this enhanced measurement option here now what that means is that Google analytics can automatically collect some events on our website like page views so that we can tell when a user goes from one page to the next whenever users are clicking links or downloading files watching videos all of that can be automatically collected for you so we're going to keep that enabled because that's nice for us we don't have to do much more than get the tagging set up and then we get that functionality so we're gonna go ahead and create stream on the next dialog there's a couple things that we want to take note of first of all we want to make sure all of our information looks correct and then we're also going to look at this measurement ID we're going to need this ID for our tagging and our tagging is what we put on our website to start sending the interactions and events that are happening from our users to Google analytics without tagging Google analytics gets no data so we have to set that up and that's the next thing we're going to do if you look through this dialogue you'll see there's a lot of different options you can see our Google tag down here there are different ways that we can set up tagging for the purposes of this series we're going to focus on Google tag manager I believe this is the best way to set up tagging because it sets you up for success in the future as well as right now because you can use Google tag manager to manage tags for all different products not just Google products so we're going to use that because I think it's a great tool that we should be using all right so let's go ahead and copy our measurement ID and then we'll head over to tag manager and get our tagging set up we can get to Google time manager directly from Google analytics so if we click out of here and we go to the top this is the tag manager icon we're going to click on that and we'll say that It'll ask us to go to Google type manager and get started so we're just going to do that it'll open up a new tab and now we're at the Google tag manager homepage and we need to create an account so let's go ahead and do that so I'm going to call this account my ga tutorials and I'm going to put in my website J tutorials.com just like we did for Google analytics and we'll click web and say create we're gonna have to agree to some terms of service and then we'll get our tag and our container set up for us and the first thing that's going to pop up is some code that we need to add to our website so that tag manager can start working for us so what we're going to do now is we're going to walk through an example of setting up tag manager and Google analytics within tag manager in our code for our website let's do it all right so first thing that we need to do is copy this script this one goes into the head the first one the second one goes into the body tag so we're going to follow the instructions of exactly what this is telling us to do I'm going to go over to my code editor Visual Studio code and I have a very very simple website already set up which you'll see in a second so we'll go to our HTML page and then in the header of our HTML we're going to paste this code so there we go we've got our code in here it copies our GTM ID over which is the ID for our container so that's what's going to happen is that when our web page loads the script is going to run and it's going to load our GTM container and then that container is going to load any other tags that we've configured within it let's go back over to the web and copy our body tag this is another script that we need we'll scroll down to the bottom of our body we'll paste that in and save it and now our container should be set up and ready to go but right now we haven't configured anything in Google tag manager to actually happen so let's go back over to tag manager and do that so we can close this since we've set up our website and now we can go ahead and configure our tag for Google analytics so go to our tags we say new tag go to our attack configuration click edit and you'll see that we have a Google analytics ga4 configuration that's exactly what we want so let's click on it we do that we're going to be asked for our measurement ID now this is the ID that we have over on our analytics page so let's go here back over to Google analytics we'll copy our measurement ID from the top right of our web stream and then we'll paste that into Google tag manager we're going to leave everything pretty much at the default here and just see what happens we need we do need a trigger we want this to load on every single page on our website and then Google Google analytics is going to do the rest they're going to have all those enhanced measurement events that we need let's rename this tag to something relevant we'll call it ga4 config for our website all right we'll save that and then we need to submit and publish these changes to our container we're just going to publish them not adding descriptions so optional and we should be good to go so let's go over to our website and see if everything is working this is our beautiful website which is a very simple demo account and keep in mind that all of the code that you're going to see here is available on our GitHub so you can find this demo website on our GitHub so that you can follow along with the example yourself all right what we're going to do is we're going to open the debug tool so on a Mac that's command option I out of Windows that's F12 and we're going to go down to our Network Tab and see what happens whenever we refresh this page all right what's going to happen is we're going to see that our GTM container has loaded and we'll see that our Google analytics tag is running you can see our measurement ID right there in the network panel so this is great this means that everything that we've done has actually worked and now we should be able to go into Google analytics and see our data so let's hop over and see if it's working all right we'll close this and just go back to our home page and now look we've got a different home page we don't have that alert telling us that we need to set up our data stream this is good news it looks like we're working so we can go over to our reports and go to real time and we should be able to see that a user will show up here in just a second okay and then after just a couple of minutes we'll see that our data has been fed from our website into our Google analytics property and we can see that now we have one user on our website this is amazing that quickly we were able to go set up equal analytics from scratch put it on our demo website run it and get data feeding into Google analytics hopefully that explains everything that you need to get started on your own website and if you have any questions please feel free to leave a comment on this video or join our Discord server and ask questions to us and the community there and we'll be sure to answer your question thank you for watching this video and I look forward to seeing you in future videos Happy measuring [Music]