alimogh / adblocker-detector

Detect if your visitors are using an ad blocker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adblocker-detector

adblocker-detector is a tiny javascript function for detecting whether or not your visitors are using an ad blocker.

Example usage:

detectAdBlock(function(active){
    if (active) {
        alert('AdBlocker detected!');
    } else {
        alert('AdBlocker not detected. All clear');
    }
});

* Once executed, ad blocker status is made available via window.__adblocker__, so for future runs, use:

if (window.__adblocker__) {
    alert('AdBlocker detected!');
} else {
    alert('AdBlocker not detected. All clear');
}

Enjoy!

About

Detect if your visitors are using an ad blocker

License:The Unlicense


Languages

Language:JavaScript 100.0%