This site should help developers to use BlockAlyzer features. It is still under construction.

React on adblock users

Obviously, BlockAlyzer has to detect adblock users before counting them. You can use the result to create your own reaction like a friendly message to turn off adblock or even forward a user. Have a look at the article I wrote on how to react on adblock users in JavaScript and PHP. It explains the variables and constants set by BlockAlyzer and how to use them. The following is just the short list:

Javascript variable

ba_blocked
= true if adblock detected
default value: false

Use this within or after wp_footer (after the BlockAlyzer JavaScript code)

PHP constant

BA_ADBLOCK_ENABLED
= true (boolean) if adblock detected
default value: false

Use this in a template file or the functions.php or in plugins that are loaded after BlockAlyzer. Is set with the result from the JavaScript check after a new page view. So might not react right after deactivation of adblocker, but after the next page reload.

Cookie

$_COOKIE[‘BaAdBlock’]
= “enabled” (string) if adblock detected
default value: “disabled”

Use this in PHP, if you need a very early check, like within a plugin. Also needs an additional page reload compared to the JavaScript method.