Discussion:
Tracking stuff on a page
(too old to reply)
b***@hotmail.com
2017-06-27 18:15:59 UTC
Permalink
I'm just curious - suppose there's a page with ads on it from an ad network, say Google. When the ad is fetched from Google, does it know WHICH PAGE the request came from, ie. which URL? (it would have to, right?)
When one page is obtained, the browser just gets the index.html file, and then scans that file to get all files it references, right? - so how would a "<img src=www.site.com/pic.jpg" on that page TELL the jpg's server which page that request came from? ie. which URL?

Is this the Referrer header at work? (wouldn't *seem* like it, from whatever I know about it....?) - the Referrer header is for when you CLICK on a link - it tells the new page which URL it came from....?

Thanks.
Barry Margolin
2017-06-28 20:01:06 UTC
Permalink
Post by b***@hotmail.com
I'm just curious - suppose there's a page with ads on it from an ad network,
say Google. When the ad is fetched from Google, does it know WHICH PAGE the
request came from, ie. which URL? (it would have to, right?)
When one page is obtained, the browser just gets the index.html file, and
then scans that file to get all files it references, right? - so how would a
"<img src=www.site.com/pic.jpg" on that page TELL the jpg's server which page
that request came from? ie. which URL?
Is this the Referrer header at work? (wouldn't *seem* like it, from whatever
I know about it....?) - the Referrer header is for when you CLICK on a link -
it tells the new page which URL it came from....?
Referer is also sent for images. Basically, any time a URL is accessed
because of a reference from a web page, the web page's URL is sent as
the Referer (there some some exceptions: an HTTPS page accessing an HTTP
image won't send Referer).

However, ads these days are usually implemented using Javascript, and
the script has access to the URL of the page.
--
Barry Margolin
Arlington, MA
Loading...