I am trying to develop a way to tell if ghostery is blocking google doubleclick ad scripts from loading. I don't want to use a listener, I want to just be able to tell if that script or url is blocked. I came up with this which always errors out but I can differentiate the error messages. Hoping for a better solution than a broken ajax call.
I just want to report how many users not seeing ads because they are using an ad script blocker enabled.
$.ajax({
url: 'http://www.googletagservices.com/tag/js/gpt.js',
type: 'GET',
error: function(d) {
console.log('error', d, '/error');
if(d.statusText != 'error') {
console.log('ghostery enabled');
} else {
console.log('script is not blocked');
}
}
});