setTimeout(function(){document.getElementById("submit").addEventListener("click", function(){ ScriptData();console.log("scriptdata");})},3000); function ScriptData(){ //optout Data var DataOptOut =(function(){if(document.getElementById("AnOptOut").value == "Ja"){ return 'var gaProperty = \''+document.getElementById("gaId").value+'\';var disableStr = \'ga-disable-\' @ gaProperty;if (document.cookie.indexOf(disableStr @\'=true\') > -1) {window[disableStr] = true;}function gaOptout() {document.cookie = disableStr @ \'=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/\';window[disableStr] = true;}'; }else {return ""}})(); // nur Analytics var DataGA = (function(){ switch(document.getElementById("Aktivieren").value ){ case "Ja": return 'window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag(\'js\', new Date());gtag(\'config\', \''+document.getElementById("gaId").value+'\''+document.getElementById("AnIpAnno").value+');'; break; case "Banner": return 'window.dataLayer = window.dataLayer || [];function getCookie(cname) {var name = cname @ "=";var decodedCookie = decodeURIComponent(document.cookie);var ca = decodedCookie.split(";");for(var i = 0; i