Detect Adblock: Our Secret Sauce
How do we do it?
We’re often asked how our adblock detection script works its magic: how do we detect that someone is blocking ads? Most people expect us to guard this secret closely, but the truth is we use an approach that’s widely discussed online. We observe what happens when a web page loads and detect the effects of adblocking plugins.
Understand Ad Blocking
The second technique used to block ads is to hide ad-related page elements based on css rules. Publishers carefully design their web pages with space for both content and advertising, but when ads are blocked this could leave large, empty areas on screen. The adblock community’s filter lists specify page elements that should be hidden, for example any element with the ID ‘leaderboard-ad’. Page elements that match standard ad dimensions are also hidden. By hiding these page elements, adblock ensures that the space they would have taken up can be re-used by other parts of the page, such as the main page text. This has the bonus side-effect of also hiding any ads that slip by the first blocking technique.
Choose Your Bait Carefully
The Devil is in the Detail
As always, there’s more to this than meets the eye. Anyone who’s tried their hand at web development will be familiar with the frustration of cross-browser (in)compatibility and the challenge of staying current with a shifting landscape of browser and plugin technologies. Not to mention the challenge of building a scalable server infrastructure that can handle vast quantities of analytics traffic in real-time. We won’t bore you with complaints here though; hopefully you’ve now got enough information to understand what’s going on in the background when you sign up to use our free adblock measurement service.