How does a 3rd party tracking cookie provider know where their cookies come from? - cookies

I know how normal cookies work and that a browser attaches them to every request to the cookie's domain. I also watched a couple of videos about 3rd party tracking cookies that get send to the tracking site when they are requested by a browser loading the main site and thus the tracking site gets to know where their cookie comes from and this way can track you.
However, what I don't get is how the 3rd party tracking site gets the information about the source? Is the browser sending some kind of a referral and so revealing to them what website I opened or how does this magic work?

Related

Identify third party cookies in chrome [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
In the process of making a website GDPR compliant i need to identify and categorize cookies used on that website. Now i came across the issue to differentiate between first and third party cookies.
I was not able to find the information how to do that. So my question is: how can i find out if a cookie is a third-party-cookie with help of the developer tools of chrome and relative to the current website open.
Thanks a lot!
OK user3507003.
I am going to try to answer your question, even though I am not an expert on cookies. I am very interested in the topic however, so as I say, I am going to try to answer your question.
I am going to include background information on the subject as I try to answer your question, as the intent, purpose, and history of website cookies is short and sometimes confusingly often changing. You might like to skip to the TL;DR section near the end, for some reason I felt like pressing computer keyboard buttons for more than an hour and fifteen minutes this morning. I also just like thinking about the idea of "party cookies".
Being sure to define what is meant by "cookie": A 'cookie' is a small piece of data that is sent by a website server as part of the HTTP/S protocol as part of a response for a browser request for a webpage, then is stored locally by the browser, then is sent along with subsequent browser requests for website pages. What can make that confusing is when you ask your browser to ask a webserver for a web page, the request for the webpage can sometimes involve more than one HTTP request and to different servers for different parts of the webpage. Depending on cookie data property values different cookies could sometimes be sent with those different HTTP requests for webpage parts.
That explanation does not explain the difference between first party and third party cookies. It covers both indiscriminately. My US market-leading internet search engine (Google) results ((which should be largely unbiased by account histories except somewhat anonymized cookie data)) for "are there other types of cookies than party cookies" confirms that some websites talk about 'session', 'persistent', and 'third-party' cookies. That distinction is likely not directly relevant to your question, but it might be useful to know.
To be clear, what I think you are asking, and what I am trying to answer, is how you can tell the difference between third party cookies and first party cookies in the context of the developer tool storage inspector, as you have shown in a screenshot of that.
In your screenshot, on the left is an expandable view of the types of data storage that your browser (Chrome) supports, including "Local Storage" and "Cookies", among other types of storage. You have expanded the 'Cookies' section and selected the first item in the 'Cookies' list, and the inspector is showing a list of more than eighteen different cookies, starting with an 'ads_prefs' cookie.
The list on the right, starting with the 'ads_prefs' cookie is a list of cookies that were set by the selected website server in the list on the left. This is where my experience with cookies is less than sure, but I think you are confused that there are now two website domains involved with each cookie in the data you are seeing as in your screenshot.
The list of website domains on the left shows website domain servers that have set cookies as part of the most recent webpage request of your browser. All of the website domain servers that are not the domain of your original webpage request are third party servers with respect to your requested webpage. Those requests to third party servers are often pixel image trackers, advertising brokers, that sort of thing.
The cookies set by any website servers that are not the website domain server for your initial request (the first domain in the Cookie section view list on the left) are, I believe, considered "third party cookies".
The list of cookies on the right has a "Domain" column. What this should mean is that the Chrome browser is conformant to an HTTP/S cookie specification that allows webpage responses to set cookies for your browser that are intended for other webserver domains, and not the server that set the cookie. That "Domain" cookie property name does complicate the vocabulary around first party and third party servers and cookies, but once you understand the context as centered around a browser's webpage request, consistent disambiguation would be excessive.
TL;DR
The cookies set by the first-listed first party server as intended for other webpage domain servers are considered 'first party cookies' (with central respect to your first browser request for a webpage), even though they can involve another website domain as an intended recipient. All of the other cookies set by other servers (that were not the domain webserver for your initial browser webpage request) are 'third party cookies'.
Disclaimer: I could be wrong about some or all of that.

Google NID Cookie

I'm not sure if this is the right stack to ask this in so if not please let me know!
I am trying to get a handle on what cookies are used on a site and what they are for. When I initially did a cookie scan I noticed a cookie names NID which was set by google.
I have tried to research this cookie and can see it is used by Google for advertising purposes.
But I am confused about why and where this is being set, the site I am looking at does not use advertising anywhere, although it does use embedded YouTube videos.
Can anyone shed any light on when and why this cookie is set?
according to Google
Most Google users will have a preferences cookie called ‘NID’ in their browsers. A browser sends this cookie with requests to Google’s sites. The NID cookie contains a unique ID Google uses to remember your preferences and other information, such as your preferred language (e.g. English), how many search results you wish to have shown per page (e.g. 10 or 20), and whether or not you wish to have Google’s SafeSearch filter turned on.
For me, the cookie was hammered incessantly by the url https://www.google.com/s2/favicons?domain=example.org Which was being used by CookieBro & FeedBro RSS feeder browser addons for retrieving icons associated with various domains. The cookie can be dropped by either an addon or by google itself.
I used cookie log via cookiebro addon for firefox & chrome to detect these cookies in realtime, its one of a kind. However I did not realize it was cookiebro dropping them until the next step below.
To see what background connection is occuring when these cookies are placed, enter the following firefox url: about:cache?storage=disk&context= and you will see when and where the google url being connected to.
It is said this cookie is for targeting & ADS and the google's settings are integrated to make the cookie inconvenient to delete for Google users.

GTM Cross-Domain Tracking for new AdWords conversion

You may all know that Apple introduced 3rd party cookie deletion after 24 hours into Safari 11 on Mobile and Desktop called Intelligent Tracking Prevention ITP.
This forced Google to change their AdWords pixel to use a 1st party instead of a 3rd party cookie.
I'm not sure what to do in the following scenario:
Landing page is domain1.com with a link to domain2.com/register where users can fill out a form and convert and it will load domain2.com/thankyou
In the past I would just set up GTM like this:
Tag: AdWords Remarketing
Trigger: All Pages
Tag: AdWords Conversion
Trigger: Page View, where url=domain2.com/thankyou
Tag: Universal Analytics
Set field: autoLinker=true
Add cross-domains: domain2.com
Trigger: All Pages
This worked perfectly because Analytics uses a 1st party cookie, so we make sure the cross-domain tracking for Analytics works. For AdWords we didn't need to worry, as it used a 3rd party cookie that will perfectly work across domains.
Question
Since AdWords switched to a 1st party cookie, they nag us in GTM to add a Conversion Linker without much settings to set. I don't see how this works with a 1st party cookie, without a cross-domain linker for AdWords.
Any ideas if for AdWords everything just works without any sort of cross-domain linker?
So one and a half years later this gets finally fixed by google. GTM allows for link and form decoration, to transfer it's 1st party cookie to the second domain:
https://support.google.com/tagmanager/answer/7549390?linkId=58009916
"Enable linking across domains"

Need to track what websites a user visits after leaving my site

I would like to track what websites my site's visitors go to after they leave.
Would it be possible to place a cookie on their browser when they visit my site, and then later if they go to Facebook.com or stackoverflow.com, my cookie will retreive the browser's URL data and send it back to my server.
I could then look at this data and know that my visitors had gone to Facebook.com and stackoverflow.com after they left my site.
Is this possible using cookies?
Thanks for the help.
No. Cookies are not executed or anything. They are just dumb bits of data.
You would need to be able to execute code on the page they are visiting afterwards.
What I presume you are trying to ask, is that you want to track your outbound links.
This is mainly done with Javascript: You need to intercept click events from outbound anchor links, and send an event notification as described here, or using the hitCallbackmethod prior to completing the redirection to the external website. For Google Analytics see documentation. Or you could do via a custom JS implementation sending the info back to your server instead.
Alternatively your could replace all outbound links on the server side in your html source, and have all links pointed to your server first, and redirected to the external sites. But using redirects for this purpose is not really a good recommendation, unless you are an ad networks or a search engine company requiring such method.
Lastly, there is an alternative method using the HTML5 'ping' attribute. But the feature has been either removed and/or not yet fully implemented across all browsers as of this writing.
But you can't track where your visitors go beyond the 1st level outbound links of your site.

Is there something a site can do to incorporate third party cookies

I work for an e-commerce site. Part of what we do is to offer customized items to some clients. Recently some non-technical management promised that we could incorporate our check-out process into one such client's website. The only way we've figured out how to do this is by using an iframe (I know, I don't like it either). The issue is that most customers of this site are unable to check out because we use cookies to determine which custom items to display. Browsers are recognizing our cookies as third party and almost everybody has third party cookies turned off, as they should. I'm going to be shocked if the answer is yes, but is there any workaround for this? ie can the site hosting our iframe somehow supply the necessary cookie?
Try an invisible, interstitial page.
Essentially the hosting site would issue a redirect to a site within your domain, which is then free to set cookies (because at this point is is actually the first party). Then your site immediately redirects back to the hosting site. At this point your newly-created cookies will be invisible to the hosting site but visible to your iFramed page henceforth.
Unfortunately the hosting site will have to do this every time a cookie is to be updated but the double-redirect can happen so quickly they'll hardly notice. Hopefully your system only needs the cookies to be set once.
Instead of using a cookie, pass the information in the each url request as name/value pairs.
It is a bit of a pain to add the name/value to every url...I know...oh well...it will work.
I'm going to be shocked if the answer is yes, but is there any workaround for this? ie can the site hosting our iframe somehow supply the necessary cookie?
Your iframed page itself, which is the third party in this scenario, could send a P3P Cookie Policy header – some browsers then accept third-party cookies by default, whereas others (mainly Safari) will not be convinced to do so at all if not by the user manipulating the default settings themselves.
What you could also do, is pass the session id not (only) by cookie, but as a GET or POST parameter as well – f.e. under PHP this can be done quite easily by configuring the session options. You should consider if that’s worth the slightly increased risk of session stealing.
The interstitial page solution should work but it might be a lot of trouble for your hosting site, so here's another solution that will allow you to work cookieless.
Write an HttpModule that responds to the BeginRequest event, reads the querystring, and inserts corresponding cookie headers into the Context.HttpRequest object (Note: you can't use AddCookie, you have to use AddHeader, because cookies added by a module directly are disposed of before they hit your application proper). That way the hosting site can simply issue a request (within the iFrame) that contains the necessary value in the querystring, the module will convert it into a cookie (that only exists in memory, not on the wire), and your application will be deceived into thinking that there's a cookie there. No code changes required, you just need to add the module in web.config.
This only works if you are using IIS 7.0+ in integrated pipeline mode. If you're on an earlier version of IIS or if you have to run in classic mode, you'll need an ISAPI filter instead.
Ryan , John
For the Chrome v80 update with SameSite flags, want to set the samesite=none;secure for the site hosting our iframe and somehow supply the necessary samesite=none;secure cookie. We have apache 2.2 and tomcat 6 setup, so would appreciate a solution and advice on how to make it work. Currently with flag enabled the iFrame is not punching out successfully.
Thanks