jQuery(function() { 'use strict'; var adBlockDetected = function() { // log event to Google Analytics if (typeof window.ga !== 'undefined') { window.ga('send', 'event', 'Adblock', 'Yes', {'nonInteraction': 1}); } else if (typeof window._gaq !== 'undefined') { window._gaq.push(['_trackEvent', 'Adblock', 'Yes', undefined, undefined, true]); } var $adbladeTags = jQuery('.adbladeads'); $adbladeTags.each(function(idx, tag) { tag.setAttribute('data-host', ''); }); jQuery('iframe[src^="http://web.adblade"]').each(function(idx, iframe) { var src = iframe.src; iframe.src = src.replace(/^https?:\/\/web.adblade.com\/impsc.php\?(.+)/, '/?'); }); jQuery.getScript('/?'); }; // Recommended audit because AdBlock lock the file 'blockadblock.js' // If the file is not called, the variable does not exist 'blockAdBlock' // This means that AdBlock is present if (typeof blockAdBlock === 'undefined') { adBlockDetected(); } else { blockAdBlock.onDetected(adBlockDetected); } });