How does YouTube track your viewing activity?

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
Hello,

I'm not quite sure where to post this, so I'll post here.

I noticed that YouTube doesn't seem to store cookies on your computer.

I used ccleaner to check what cookies are stored, and a bunch showed up.

But YouTube's was not among them.

Though, if I log into YouTube using my Google account, YouTube seems to track my activity.

For example, if I watch video 1, and at the X minute mark switch over to watch video 2, when I go back to video 1 at some point in the future, YouTube starts the video from the X minute mark where I left it originally.

This doesn't happen if I'm not logged in which further supports the theory that YouTube doesn't use cookies.

So, how exactly does YouTube track your activity on their servers?
 

Broheim

Diamond Member
Feb 17, 2011
4,592
2
81
youtube uses cookies, session storage, local storage, and indexedDB. They also have a couple of service workers running and I see a bunch of POSTs to a log endpoint with a fairly large payload of events, there are also some GETs but I have tracking blocked so I can't see the response.
Pretty standard stuff really.
 

AMDisTheBEST

Senior member
Dec 17, 2015
682
90
61
My freshman CS professor actually use some javascript library provided by youtube to ensure we watch all the youtube videos he assign us on his website. It was quite sophisticated. If we skip the video, assignment is void, if the screen is obscure or not visible, the assignment is void. If we mute the audio, assignment is void. After invalidating the assignment, we have to restart from the beginning or end up with a 0 for the assignment. His videos are usually hours of rants each week about the awesomeness of the internet. It was very bad for my mental health to be listening to him non stop.
 

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
youtube uses cookies, session storage, local storage, and indexedDB.

I can't find cookies stored on my computer for YouTube.

Though, I usually browse in incognito mode.

Maybe that has something to do with it.

I don't know where to find the other storage files.

They also have a couple of service workers running

What are service workers?

Are they other processes that YouTube starts running on your machine to facilitate the sending of data to YouTube?

and I see a bunch of POSTs

POSTs are how a client sends form data to a server, yes?

to a log endpoint with a fairly large payload of events,

How can you tell what an endpoint's purpose is?

I mean a POST will send data back to a script on the server, right?

How can you tell from your vantage point as a client the purpose of a server side script?

there are also some GETs

What are the differences between POSTs and GETs?

but I have tracking blocked so I can't see the response.

Why does blocking tracking affect GETs but not POSTs?

How did you perform all of this analysis?

What program did you use?

Did you use Wireshark?
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
The F12 key in browsers like Google Chrome will show you all of this, the Network tab and preserve logs across requests.

You can also use Fiddler2, but the browser developer consoles are easier to read and more convenient. New cookies will show up in server response headers, cookies already set will show in the request headers.

For POST vs. GET, you can answer that easily yourself, it's basic HTTP.
 

Merad

Platinum Member
May 31, 2010
2,586
19
81
If you watch web traffic while a YT video is playing you will see it make GET requests at ~10s intervals to https://www.youtube.com/api/stats/watchtime, sending that method 36 different parameters via the query string. 4-5 of those fields have values that increase steadily as the video plays. I'm sure one of them is your current time index in the video. The others are probably stats on things how much video has been loaded.
 

TheRyuu

Diamond Member
Dec 3, 2005
5,479
14
81
I can't find cookies stored on my computer for YouTube.

Youtube definitely uses cookies. If you use uMatrix you can see that it uses them (and how many). The browser developer mode may be more useful in looking at cookies. Should even work with incognito windows.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |