var script = document.createElement('script'); script.src = "https://www.googletagmanager.com/gtag/js?id=GTM-5W2B6ND"; script.onload = function () { window.dataLayer = window.dataLayer || []; gtag(window.dataLayer.push(arguments)); gtag('js', new Date()); gtag('config', 'GTM-5W2B6ND'); console.log("track GTM"); }; document.getElementsByTagName("head")[0].append(script); if ($('.google_map').length >= 1) { var script_tag = document.createElement('script'); script_tag.setAttribute("type", "text/javascript"); script_tag.setAttribute("src", "//maps.google.com/maps/api/js?callback=initializeGmapInContent&language=" + sgLang() + "&key=AIzaSyAhtzfr20j43t9dmAR-Rtc0yiLZkuMyonU"); (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag); console.log("GoogleMaps initialisiert..."); } var script3 = document.createElement('script'); script3.src = "https://www.googletagmanager.com/gtag/js?id=G-9YXQD7Z3NY"; script3.onload = function () { function thridGtag(){dataLayer.push(arguments);} thridGtag('js', new Date()); thridGtag('config', 'G-9YXQD7Z3NY'); console.log("track GTM III..."); }; document.getElementsByTagName("head")[0].append(script3);