I've been using EFF's "Privacy Badger" to try to cut down on this, with fairly good results (it doesn't break too many things): <a href="https://www.eff.org/privacybadger" rel="nofollow">https://www.eff.org/privacybadger</a><p>The basic idea is that it can either fully allow a third-party image/script, allow the load but block third-party cookies, or block it entirely. There are some history-based heuristics (can be overridden) to figure out which makes most sense.<p>HN discussions: <a href="https://news.ycombinator.com/item?id=7789350" rel="nofollow">https://news.ycombinator.com/item?id=7789350</a>, <a href="https://news.ycombinator.com/item?id=7684287" rel="nofollow">https://news.ycombinator.com/item?id=7684287</a>
I use DNS to block this sort of stuff (doubleclick.net, googleapis.com, etc.). *.doubleclick.net, etc. redirect to a a socket logger so I can see what is being requested.<p>This is easy for me to do because I run my own DNS root.<p>I also use DNS in order to log requests from devices that phone home (e.g., Apple).