I just installed Ghostery on my browser, and when accessing any random page, I see a lot of advertising trackers that, however, don't appear in the page's source code.
For example, let's take http://www.latimes.com: according to Ghostery, one of the ad trackers it loads is by AppNexus, and the URLs it shows are of the form http://secure.adnxs.com. And yet, if I do "view source", I don't see that URL anywhere in the page. At least in the case of Google and Doubleclick's trackers, I can find them in the source (and conversely, when I read the page, all the ads I see come from Google/Doubleclick).
Obviously these trackers are being loaded through Javascript... but where? Which code is redirecting and loading those trackers? The only way I can think of is if they come from the Doubleclick code... but, aren't AppNexus (and all the other ad networks) supposed to be Doubleclick's competition? Why would Doubleclick load their competition's trackers? How does that even work?
(I know about real time bidding, supply side platforms and so on, at least in theory. I'm just trying to understand how it all works, using this practical example).
var ensightenUrl="//nexus.ensighten.com/tronc/latimesarc"