Detect Ad blockers and statistics
Statistics on the use of advertising blockers
Nowadays, many visitors use ad blockers (adblock, adblock plus, etc.) to remove ads from websites. The ever-increasing use of such software can significantly affect the revenue generated by a website.
Our web analytics service provides detailed statistics on the use of these ad blockers, so that you can evaluate their impact on the monetization of your website.
Advanced detection and reliable results.
Using two different algorithms, AFS Analytics detects ad blockers on all devices: Computers, Tablets and smartphones.
A solution to fight against ad blockers.
The best way to combat ad blockers is to display a warning message or banner asking the user to disable it. For this reason, the analytics.js library allows you to define a (callback) function in JavaScript which will be called every time an ad blocker is detected. You will find an example of use at the end of this document.
Selecting the ad blockers statistics report.
From the main menu, select
Summary of statistics
This graph shows you the percentage of visitors using ad blocking software.
List of visitors using ad blockers.
This list displays visitors using ad blockers.
Daily and monthly statistics reports
These reports display the number and percentage of visitors using ad blockers.
Detect Ad blockers and display a warning banner with analytics.js
<!DOCTYPE html>
<html lang='en'>
<head>
<style>
#adblock_box {
display: none;
margin-bottom: 30px;
padding: 20px 10px;
background: #D30000;
text-align: center;
font-weight: bold;
color: #fff;
border-radius: 5px;
}
</style>
<title>Detect Adblock</title>
<script>
(function(i,s,o,g,r,a,m){i['AfsAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//code.afsanalytics.com/js/analytics.js','aa');
</script>
</head>
<body>
<div id="adblock_box">
Our website is made possible by displaying online advertisements to our visitors.<br>
Please consider supporting us by disabling your ad blocker.
</div>
<script>
//your callback function
function detected_adblock(vis)
{
//vis contains information about visitor, we don't use
//display the advertisement
console.log(vis);
document.getElementById('adblock_box').style.display='block';
}
//create tracker
aa('create', 'xxxxxxxx', 'auto','auto'); //your trackingid here!
//set the callback function
aa('set',"adblock_callback",detected_adblock);
//send pageview
aa('send','pageview');
</script>
This is a page test for adblock detection with AFS Analytics.
</body>
</html>
Note: Detection of ad blockers requires a premium subscription plan and version 7 or higher of the tracking code pasted on your website pages.
By AFS Analytics, Monday, July 10, 2017