mirror of
https://gitlab.com/skysthelimit.dev/selenite.git
synced 2025-06-16 02:22:07 -05:00
test google analytics
This commit is contained in:
parent
7b5fbb8c1f
commit
917545c951
12
js/all.js
12
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';
|
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js';
|
||||||
head.appendChild(script);
|
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 () {
|
defer(function () {
|
||||||
panicMode();
|
panicMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function defer(method) {
|
function defer(method) {
|
||||||
if (window.jQuery) {
|
if (window.jQuery) {
|
||||||
console.log("jquery found.");
|
console.log("jquery found.");
|
||||||
@ -78,4 +86,4 @@ function defer(method) {
|
|||||||
setTimeout(function() { defer(method) }, 50);
|
setTimeout(function() { defer(method) }, 50);
|
||||||
console.log("jquery not found, adding jquery.");
|
console.log("jquery not found, adding jquery.");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user