如何使用第三方“跟踪Cookie”工作? [英] How do Third-Party "tracking cookies" work?

查看:121
本文介绍了如何使用第三方“跟踪Cookie”工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在这里阅读这个问题:
如何互联网广告客户使用第三方Cookie?
了解第三方跟踪Cookie的工作方式,但仍然很困惑。
我不明白如果我访问网站A(一个有广告的正常网站)如何网站B(广告网站)可以分配我的电脑的ID,然后弄清楚我在网站A和其他

I have read this question here: How Do Internet Advertisers Use Third-Party Cookies? on how third-party tracking cookies work, but am still very confused. I don't understand how if I visit Website A (a normal website with ads) how Website B (an advertising website) can assign my computer an ID, and then figure out that I was on website A, and other websites after it that have its ads.

推荐答案

首先,通过HTTP标头设置和检索Cookie。如果您的浏览器向 http://example.com 发送请求,则响应可能会返回一个标题为 Set-Cookie:foo = bar 。您的浏览器存储此Cookie,并且对 http://example.com 的任何后续请求,您的浏览器将发送 foo = bar 中的。 (或至少直到cookie过期或被删除。)浏览器发送 foo = bar cookie与任何请求到 http://example.com ,无论发起请求的人或上下文是什么。如果 http://example2.com 包含标记< img src =http://example.com/img .jpg> ,那么浏览器在获取 foo = bar com / img.jpg> http://example.com/img.jpg ,即使 http://example2.com

First, cookies are set and retrieved through HTTP headers. If your browser sends a request to http://example.com, then the response might come back with a header that says Set-Cookie: foo=bar. Your browser stores this cookie, and on any subsequent requests to http://example.com, your browser will send foo=bar in the Cookie header. (Or at least until the cookie expires or is deleted.) The browser sends the foo=bar cookie with any request to http://example.com, regardless of who initiated the request or what the context is. If http://example2.com contains the tag <img src="http://example.com/img.jpg">, then the browser will send the cookie foo=bar when it fetches http://example.com/img.jpg, even though http://example2.com is responsible for the request being sent.

因此,如果网站A包含由网站B投放的广告,则网站B可以在您的浏览器中设置Cookie。例如,或许网站A使用< iframe src =http://websiteB.com/ad.html></iframe> 从网站B投放广告。然后当你的浏览器访问 http://websiteB.com/ad.html 时,响应将返回一个 Set-Cookie 标头,用于设置一个具有唯一随机字符串的Cookie。如果网站C还包含来自网站B的广告,那么当网站C上的广告从网站B获取时,将发送该唯一Cookie。

So, if website A contains an ad that is served by website B, then website B can set a cookie in your browser. For example, maybe website A uses <iframe src="http://websiteB.com/ad.html></iframe> to serve the ad from website B. Then when your browser goes to fetch http://websiteB.com/ad.html, the response will come back with a Set-Cookie header that sets a cookie with some unique random string. If website C also includes an ad from website B, then that unique cookie will be sent when the ad on website C is fetched from website B.

至于网站B如何知道您访问的是哪个实际网站,有多种方法。在某些情况下,当浏览器向一个网站发送请求时,因此,当浏览器访问 http://websiteB.com/ad.html 时,它可能包含HTTP标头 Referer:http://websiteA.com 告诉网站B请求是由网站A发起的。每当网站B看到它分配给您的唯一随机字符串时,它可以检查Referer标头以添加到您的历史记录。如果网站A与网站B合作,则A可以直接告诉B您来自网站A.例如,网站A可以通过使用< iframe src =来包括来自网站B的广告, http://websiteB.com/ad.html?referer=websiteA.com> ,然后网站B就会在查询字符串中看到引荐来源。

As far as how website B knows which actual website you're visiting, there are a variety of ways. In some cases, when the browser sends a request to one website, it tells the website which website you're coming from. So when the browser goes to fetch http://websiteB.com/ad.html, it might include the HTTP header Referer: http://websiteA.com that tells website B that the request was initiated by website A. Every time website B sees the unique random string that it assigned to you, it can check the Referer header to add to its log of where you've been. If website A is cooperating with website B, A can just directly tell B that you're coming from website A. For example, website A could include the ad from website B by using <iframe src="http://websiteB.com/ad.html?referer=websiteA.com">, and then website B will see the referer in the query string.

这有帮助吗?你链接的答案中有什么特定部分对你没有意义吗?

Does that help? Are there particular parts of the answer you linked that don't make sense to you?

这篇关于如何使用第三方“跟踪Cookie”工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆