Detect AdBlock on user's browser and show message

3

Is there any way, can it be via JS, that detects that the user is using AdBlock and send some message to it?

    
asked by anonymous 19.07.2015 / 05:01

1 answer

3

There are several ways to try to check Adblock, here are a few:

$(document).ready(function(){
    DetectarAdBlockUser();
});

function DetectarAdBlockUser() {
if ($('.ClassDosSeusAds').filter(':visible').length == 0) {
    $('divAvisoAdBlock').show();
} else if ($('.ClassDosSeusAds').filter(':hidden').length > 0) {
    //colocar o que quer fazer caso alguns estejam hidden
} else if ($('.ClassDosSeusAds').height() == 0) {
    //colocar o que quer fazer
}

In case it is verified the existence of the attribute hidden, height equal to zero and if it is not visible.

Note that each adblock varies in its execution form and new updates can lead to ways to avoid this type of detection

    
19.07.2015 / 07:31