var geo_code = 'gb'; var eucntry = true; function consent_show() { var consent_html = ` `; setTimeout(function () { document.body.insertAdjacentHTML("beforeend",consent_html); document.getElementById("consentdiv").style.display = "block"; },1000); } function consent_kaopen() { document.getElementById("consentka").style.visibility = "visible"; } function consent_submit() { //alert("Onaylandı: "+document.getElementById("cnsntm").checked); if(document.getElementById("cnsntm").checked){ consent_setCookie("ck_cnsntm","true",1000); dfp_load_ads("true"); ga('sxwTracker.send', 'event', 'EUGDPR', 'Yes'); } else{ consent_setCookie("ck_cnsntm","false",1); dfp_load_ads("false"); ga('sxwTracker.send', 'event', 'EUGDPR', 'No'); } document.getElementById("consentdiv").style.display = "none"; } function consent_setCookie(name,value,days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/"; } function consent_eraseCookie(name) { document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; } function consent_getCookie(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; } var ck_cnsntm = consent_getCookie("ck_cnsntm"); console.log("Consent Cookie: ",ck_cnsntm); if(ck_cnsntm!="true" && ck_cnsntm!="false"){ dfp_willload = false; consent_show(); }