The Google Analytics Cookie (Explained)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
How does Google Analytics identify users that it's tracking? When you go from page to page, how does Google Analytics know that you are still the same person? And even if you leave the website and come back later on, how does Google Analytics identify you as a returning user? How does it do that? Well, it's actually pretty simple, like most tracking technologies out there it uses cookies. And today Pavel is going to explain to you how the Google Analytics Cookie works in combination with our tracking code to send them data to Google Analytics. And we've got lots to cover. So Pavel take it away. As we know Google Analytics measurement is cookie-based. It means that part of the important information necessary for correct measurement is stored in a cookie. Cookies are small files, which are a stored in browser, and this is worth remembering. Let's have a first look, how can we access them and what exactly is stored in them. If we want to access cookies, we have to open a browser for purposes of this video. I chose Google Chrome and the next step is to open Dev Tools it's done by right-click to any element of the website, and then clicking here on inspect. And here we are. This bottom part is Dev Tools right now. It's quite small, so it's not easy to browse it properly. So I recommend you to open it in a separated window, which is done by clicking here on this three small vertical dots, and then choosing this. And here we are, and accessing cookies is done by clicking on the application part. And on the very left side, we can see here cookies, right? And I want to see cookies for Google Merchandise Store, as you can see, there's about 10 of them. And the first one, uh, this one GA is Google Analytics Cookie. Uh, here is it's value GA one dot two dot sequence of numbers and also it value is available here. Uh, right now it's value might seem to you like a randomly generated sequence of numbers and characters, but it's not the case. Uh, and the next step for proper understanding how the measurement is done is to break it down to smaller parts and understand its values. So let's do it. This is the example of how Google Analytics Cookie might look like. Um, the first part of it is always the GA version either GA dot one dot two, or GA dot one dot one. It depends on the Google Analytics measurement code you're using. So it's either for a Universal Analytics, GA dot one dot two or GA dot one dot one for Google Analytics Four then it's a random number. And then the last part of it is the first time stamp The first time stamp is the moment in time when you as a user visited particular website for the first time and these two numbers, I mean the random number and the first time stamp gives us something we call client ID, which is a unique identifier of a user. Next thing for proper understanding how the measurement is done is, uh, How the data is being sent to Google Analytics servers. Let me show in the very simplified version how it works, and then we will go back to browser to see how the technically is data being sent. So on the left side, we see here a very simplified version of the HTML code were also part of it as a JavaScript, uh, code for Google Analytics measurement. One of the first thing a measurement code is asking if, is there a Google Analytics Cookie? If the answer is yes. Then the measurement code grabs this value from the cookie it knows that it's a returning visitor and then uses this information when sending the data to Google Analytics server, if not, then it's a signal that it has to create a new cookie based on the rules we just explained. And then also use it for a further Google Analytics measurement. Now let's go back to browser to explain where we can see how the data is being sent to Google Analytics servers. Exactly. As in the case of cookies, we again have to open Dev Tools. So, uh, right click then inspect. And right now, it automatically opens in a new window. Uh, in the case of cookies, we went to application tab but for seeing the server call, we have to go to network and here we are right now, we don't see anything, but that's correct, uh, for seen what is happening here in the network I will reload the website by pressing command and R. And you'll see that immediately. It will appear a lot of lines here. Uh, what is basically done here or what is it showing us is the communication between you and the server from which you're getting the data. And we can see that right now. It's 89 requests. We can see it's, uh, a lot of, a lot of, uh, script here. Uh, PNGs, which are images fonts and so on and so on. So basically any communication between your browser and the server from which you're getting the data. And also part of it, our Google Analytics data, I will filter them by typing here, into filter apart part Google, hyphen, Analytics I'm pressing Enter. Uh, and most of these lines we see are server calls, which means the format in which the data are being sent to Google Analytics server. So for example, I will take this one and as you can see, it's a request URL, which is URL address in which all the necessary information for Google Analytics are being sent. Uh, very similarly, as in the case of value of Google Analytics Cookie, right now, it might seem to you like something very complicated to understand, uh, and it's not the case and let's break it down to smaller elements to understand it properly. And here is the example of simplified Google Analytics server call. It's completely fine to use the simplified version because we're showing the principle how the data is being sent. So let's break it down. The first part is always the same. We're calling a Google Analytics server by URL address Google hyphen Analytics.com/collect. Then there is a hits type, which in this case is a page view. It can be for example, event or transaction. Then there's a Google Analytics account ID, which I guess you all know what it means. Then there is a client ID. Uh, we know that it's grabbed from the cookie and is the unique identification of the user. And then the last part is the document path or URL address, which is being viewed. So, um, this is the simplified version of a server call. There are of course, much more information being sent. For example, about the screen resolution about the traffic source. About the viewport and so on and so on, but this is the structure. And if I right now, will switch back to Dev Tools. Yeah, here we are. Uh, will show that all the parameters we showed on the slide are also here. So we are requesting a URL address. And Google Analytics.com/collect. Uh, we can see that there's also a document location, Google Merchandise Store. com there's also a client ID here it is. Uh, here is a Google Analytics account ID and so on and so on. So just showing you that all the parameters are here and as said there's more of them, for example, screen resolution or a view board. Yeah. And important to remember is that they do not have to be sent in the exact order. It really doesn't matter if we first send client ID and then account ID or vice versa because it's being sent in one server call and important to remember is also that it's, that is the form in which the data is being sent to GA is by requesting a URL address. And the last part of the video is to show you that the principal would just explained is working. I will do that with a very simple exercise, which is by creating specific campaign URL address using specific UTM parameters. Uh, I'm using a campaign URL Builder, which I'm sure you all know. Uh, and I'm using campaign source Measure School, campaign medium video and campaign name is Pavel. So by scrolling down here, here's the full URL address, which I will copy right now. Paste it here. And wait until the page is reloaded. Okay, it's done. I'm opening a Dev Tools and going to network to see all that server calls from GA. I will open for example, this one and also part of that server call are UTM parameters. As we can see it starts here. UTM source Measure School, UTM medium video and UTM campaign Pavel. And if I will switch back to Google Analytics account of Google Merchandise Store and going to traffic sources, I should appear here. It's working right. We see the specific medium and source we chose. Uh, if I will only filter myself. Okay. It's just me. I'm based in Prague Czech Republic. So if I will go right now to occasion, I should see here Czech Republic, which, uh, happened. So this was, this was the explanation and the example how Google Analytics data are being sent to Google Analytics servers. So, uh, hope you enjoyed it guys and see you next time. Thanks for the thorough explanation public on the Google Analytics Cookie. I need to mention, yes. Cookies have been under scrutiny lately by privacy regulations, tracking prevention methods, and the fact that you can easily just delete them from your browser too. Tracking has never been a perfect system, but there's clearly a move to a cookieless feature and there are already technologies out there that, um, don't utilize cookies and that manner to track, uh, going forward. But there are still quite hard to set up and, therefore haven't reached the mainstream of tracking technologies yet most of what Google Analytics does nowadays, even in Google Analytics Four is still based on the cookie but we need to watch the future of how it will be changing there. Now, if you found this video helpful, feel free to click that like button for the YouTube algorithm and if you want to know more about Google Analytics and the inner workings, check out this video right over there, where I explain UTM parameters in 100 seconds. Now my name is Julian, till the next time.
Info
Channel: MeasureSchool
Views: 4,980
Rating: undefined out of 5
Keywords: 3rd party cookies, How to view cookies, how do cookies work, how does google analytics track, how ads follow you around the internet, Google Analytics Cookies, ga4 cookies, tracking with google analytics, Tracking with Cookies, how to set up a cookies with GA, campaign tracking with cookies, google analytics simplified server call, storing information in a Cookie, View cookie information, viewing cookies in chrome dev tools, finding cookie in chrome dev tools
Id: o1hw6LJWboE
Channel Id: undefined
Length: 11min 55sec (715 seconds)
Published: Wed Jun 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.