diff --git a/js/all.js b/js/all.js index 2b569df7..7c08373f 100644 --- a/js/all.js +++ b/js/all.js @@ -63,13 +63,21 @@ window.onload = function() { script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js'; head.appendChild(script); } + const gscript = document.createElement("script"); + gscript.setAttribute("async", ""); + gscript.setAttribute("src", "https://www.googletagmanager.com/gtag/js?id=G-XVTVBR1D5V"); + const ingscript = document.createElement("script"); + ingscript.innerHTML = `window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'G-98DP5VKS42');`; + document.head.append(gscript, ingscript); } defer(function () { panicMode(); }); - function defer(method) { if (window.jQuery) { console.log("jquery found."); @@ -78,4 +86,4 @@ function defer(method) { setTimeout(function() { defer(method) }, 50); console.log("jquery not found, adding jquery."); } -} +} \ No newline at end of file