There is a little war going on between web ad companies and ad blocking software. For examples of ad blocking software see AdBlock and Firefox’s new tracking protection. The latter focuses on blocking tracking software some of which is ads. I don’t use AdBlock but I do have Firefox’s tracking protection enabled.
One of the reasons ad blocking software works is that ads are typically served from an ad network, not directly from the website the user is visiting. Specifically, the browser makes a separate connection to a different host to get the ad content. This makes ads easy to distinguish an ad from the rest of the site’s content.
I wonder how long the ad blocking cat and mouse game will go on before the sites that are most reliant on ads simply switch to proxying the ad content through their website. This would add some cost to running the site but it would make it much more difficult to identify which parts of the site are real content and which parts are ads.