google analytics default no consent

This commit is contained in:
ReznoRMichael 2021-01-29 00:34:29 +01:00
commit 72fb03ccb7
5 changed files with 37 additions and 17 deletions

19
src/js/analytics.js Normal file
View file

@ -0,0 +1,19 @@
/* eslint-disable no-undef */
// Temporarily disable the tracking for testing (set to false to enable Analytics)
window['ga-disable-UA-136831794-2'] = true;
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
// Default no consent to share cookie data
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics_storage': 'denied'
});
gtag('js', new Date());
gtag('config', 'UA-136831794-2');

View file

@ -10,6 +10,9 @@ require("../img/thumbnail1200x628.jpg");
// Instantly load test file (Debugging script)
// require("./LoadJson.js");
// Google Analytics start script
require("./analytics.js")
// Load Save File for opening files, decoding, decryption
require("./LoadSaveFile.js");