Forum Moderators: open
I wouldn't block visitors who use adblocking, I would do something else, but I need to find an efficient detection method.
There is an efficient way..
RewriteCond %{HTTP_USER_AGENT} Mozilla/5\.0\ \(Android;\ Mobile;
RewriteRule .* - [F]
function TestPage() {
if ($('.myTestAd').height() == 0)
alert("Please disable Adblocking to view this page");
}
$(TestPage);
The user may then click "OK" to close the alert and view the page (sans ads) but if the page is reloaded or another page is loaded, the alert continues to display. ...if the visitor has scripting set to "off" then you can send them a message to allow scripting ( so as to allow the script to fire and the "please disable adblockers" message to be shown, eventually ) within no script tags..I display direct ad banners across the top of pages. These are served by JS, so if the user has JS turned off they will see my NOSCRIPT tag asking them to turn JS on. Actually, I use JS quite a bit with AJAX navigation so a user who does not support JS can't really use my site. At one time I considered this a liability. That factor has now turned into as asset :)
and you can also sniff for adblocker behaviour using a combination of php and jquery and then serve varying content in pages or different pages or redirects, depending on the presence , or not, of adblockers..works for self hosted ads and 3rd party ads..