I just want to find out, how many of my website users are using adblock (plus/pro/whatever). For this, I have implemented the following:
In theory this should mean for example: 100 html_visits and 90 js_visits would mean, that there were 10 Users which requested the html file, but not the js file (which was blocked by AdBlock)
My problem now is, that I get 75.2% of users with an adblock, which is compared to different studies (25-30%) for my country a too large number. My website isn't tech specific, so the percentage shouldn't be that high.
Where is the error in my concept?
I append a timestamp to the js file url (/ad_server/banner/ad.js?1435143401) and disabled cache for that file (Cache-Control: no-store, no-cache, must-revalidate, max-age=0"; Pragma: 'no-cache') to prevent cache issues.
Seems like using a file named ad.js would itself be blocked by Adblockers. Since I can't see your code, I can't tell you if your logic is flawed or anything.
I wrote something like this the other day.
<html>
<head>
<script src="adcity.js"></script>
</head>
<body>
<script>
if( window.adblockerCheck === undefined ){
// adblocker blocked our fake adcity.js file
// send event to GA or other analytics provider
}
</script>
</body>
</html>
And then all that adcity.js file has in it is:
window.adblockerCheck = true;
This is the simple version. At work I ended up doing a jquery $.ajax('adcity.js') and checking the status and stuff in the .complete() callback. That way we can check for different reasons that the request may ahve failed like 'timeout', etc.