Ad-blocking – History, Impacts, Techniques and Countermeasures

Part 4: Ad-blocking Countermeasures

Detecting Ad-blocking

Since there are limited ways that ads can be blocked, detecting the blocking of ads can be done with reasonable accuracy and the methodologies of detecting ad blocking can be deployed across different platforms without excessive difficulty.

The methods I have deployed to detect ad-blocking are JavaScript based and the ad-blocking detection script is called by the "onload" event. While some types of ad-blocking could potentially be detected using server side methods, JavaScript would be required to detect most ad-blocking and ad-blocking countermeasures would not be effective with server side detection.

Were ads pulled from the server correctly? This can be detected in two ways. On the server side, the ads that were supposed to be delivered and those that were actually delivered could be logged on a page request by page request basis. On the client side, JavaScript can be used to detect if the object exists or not. Assuming width and height clues were not provided in the HTML and CSS, the dimensions of the image can also be tested.

Was the HTML code for the ad stripped from the page? This can be tested by wrapping each ad in an additional DIV tag and testing the height of the DIV tag and testing whether the ad object exists or not.

Was the ad hidden from the user? This can be detected by using JavaScript to test what the CSS display and visibility state is for the ad. It could also be tested by testing the dimensions of the ad and surrounding DIV tag.

Blocking the ad-blockers

Once ad-blocking is detected, it may be desirable to block users who are blocking ads. While detecting and redirecting users to a banner blocking page is reasonably straight forward, preventing users from disabling the detection script and circumventing these countermeasures takes a lot more work and requires a holistic approach to the entire site.

An example of a completely integrated detection and blocking script that is currently in use can be found at http://EnvironmentalChemistry.com. Users of this site are not allowed free access to the site's content pages unless its ads are allowed to display properly. If users want ad-free access to the site they are required to purchase an ad-free subscription.

Using a combination of client side and server side tricks, the blocking of users who are blocking ads could be denied access to subsequent pages on a site, rather than simply being redirected as is done on EnvironmentalChemistry.com.

If it is decided to block those who block ads, it is advisable to offer a reasonably priced ad-free subscription option for users. While it is unlikely that this would be a significant source of revenue, it does provide an ad-free option to those users who really want it and it removes the red herring defense "well, I'd pay for ad-free access if they offered it".

Making ads harder to block

The way ads are deployed makes the detecting and blocking of ads way too easy. A lot of things can be done to make ads harder to block.

Change file naming vocabulary: Commonly the URLs of ad graphics contain strings like "/ads/" or "/banners/" which URLs for other graphics files do not have. When possible, avoid using these common strings in the URLs of ads. In fact, ad graphics should be served from the same folders as regular graphics.

Use the same server for ads and other content: Typically ad graphics are served from different servers from the rest of a web site. Thus ad-blocking software only needs to block graphics coming from the ad server to block the ads. By serving the ads from the same server as the regular content, ad-blocking software can not target ads based on where they are served from.

Don't give height and width clues: since some ad-blocking software target ads based on their height and width, do not include width and height clues for ad graphics either in the HTML or CSS. Alternatively change the height or width slightly (e.g. use 469x61 instead of 468x60).

Use randomly fluctuating URL structure: this is a harder trick, but using the rewrite rule in the .htaccess file for Apache, one can add a randomly fluctuating string to an ad graphic's url making it harder to explicitly block an ad file based on its URL. This is particularly useful at thwarting ad-blocking software where users share ad-blocking definitions. Some ad or affiliate networks accomplish this same concept by serving ads from random domains.

Making ad-blocking software less reliable

Another trick that can be deployed to make ad-blocking software less reliable is designing normal content and images to look more like ads. This will trick ad-blocking software into blocking non-ad content. This will make the use of ad-blocking software a less enjoyable experience because the software will appear to be overly aggressive.

Deescalating the "arms race"

Since the beginning of Internet advertising, there has been a steady escalation in the intrusiveness of advertising techniques. In order for the countermeasures outlined above to be successful, publishers need to work towards finding a reasonable balance between their need to generate ad-revenues and users' dislike for obnoxious forms of advertising.

If users feel that these measures are aggressive and become extremely annoyed by obnoxious ads, then they will develop more aggressive ad-blocking technologies. If, however, publishers show a willingness to strike a balance it could reduce the risk of a backlash. By striking a balance, I mean although publishers were requiring users to view ads or subscribe to an ad-free subscription option, publishers would also reframe from deploying the ad formats that most irritate users even if they are the most profitable (e.g. popups, DHTML floating overlays and in some instances flash).

Although I have taken a very aggressive stance against ad-blocking software on my site EnvironmentalChemistry.com, the outcry over my tactics has subsided over the past year. In part I think this was because I did work on addressing the issues that users most objected to with ads and because I make sure users see a direct correlation between the ad revenues I generate and my ability to produce the content that draws them to my site.