(function() { var statsRoot = 'https://stats.advitum.de/'; function sendRequest(data) { var url = statsRoot + 'data.php?data=' + btoa(JSON.stringify(data)) + '&ch=' + Math.random(); var scriptElement = document.createElement('script'); scriptElement.setAttribute('type', 'text/javascript'); scriptElement.setAttribute('src', url); document.body.appendChild(scriptElement); } function createCookie(name, value, days) { if(days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else { var expires = ""; } document.cookie = name + "=" + value + expires + "; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while(c.charAt(0) == ' ') { c = c.substring(1, c.length); } if(c.indexOf(nameEQ) == 0) { return c.substring(nameEQ.length, c.length); } } return null; } function userHasAdblocker(callback = function(){}) { var classes = 'pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links'; var styles = 'width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;'; var bait = document.createElement('div'); bait.setAttribute('class', classes); bait.setAttribute('style', styles); window.document.body.appendChild(bait); setTimeout(function() { var detected = false; if(window.document.body.getAttribute('abp') !== null || bait.offsetParent === null || bait.offsetHeight == 0 || bait.offsetLeft == 0 || bait.offsetTop == 0 || bait.offsetWidth == 0 || bait.clientHeight == 0 || bait.clientWidth == 0 ) { detected = true; } if(window.getComputedStyle !== undefined) { var baitTemp = window.getComputedStyle(bait, null); if(baitTemp && (baitTemp.getPropertyValue('display') == 'none' || baitTemp.getPropertyValue('visibility') == 'hidden')) { detected = true; } } window.document.body.removeChild(bait); callback(detected); }, 1); } if(readCookie('stats2_user') === null) { createCookie('stats2_user', (Date.now() + Math.random()).toString(), 365); } userHasAdblocker(function(adBlocker) { var additional = { adBlocker: adBlocker }; sendRequest({ referrer: document.referrer, url: document.location.toString(), user: readCookie('stats2_user'), additional: JSON.stringify(additional) }); }); })();