From 72fb03ccb786b3e6040616289d9fbd5acd02a8d1 Mon Sep 17 00:00:00 2001 From: ReznoRMichael Date: Fri, 29 Jan 2021 00:34:29 +0100 Subject: [PATCH] google analytics default no consent --- docs/app.js | 12 +++++++++++- docs/index.html | 10 ++-------- src/index.html | 10 ++-------- src/js/analytics.js | 19 +++++++++++++++++++ src/js/index.js | 3 +++ 5 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 src/js/analytics.js diff --git a/docs/app.js b/docs/app.js index 851b570..17ef7fa 100644 --- a/docs/app.js +++ b/docs/app.js @@ -41,6 +41,16 @@ eval("/* eslint-disable */\n\n\n(function (root) {\n function checkInt(value) { /***/ }), +/***/ "./src/js/analytics.js": +/*!*****************************!*\ + !*** ./src/js/analytics.js ***! + \*****************************/ +/***/ (() => { + +eval("/* eslint-disable no-undef */\n// Temporarily disable the tracking for testing (set to false to enable Analytics)\nwindow['ga-disable-UA-136831794-2'] = true;\nwindow.dataLayer = window.dataLayer || [];\n\nfunction gtag() {\n dataLayer.push(arguments);\n} // Default no consent to share cookie data\n\n\ngtag('consent', 'default', {\n 'ad_storage': 'denied',\n 'analytics_storage': 'denied'\n});\ngtag('js', new Date());\ngtag('config', 'UA-136831794-2');\n\n//# sourceURL=webpack://hollow-knight-completion-check/./src/js/analytics.js?"); + +/***/ }), + /***/ "./src/js/hk-database.js": /*!*******************************!*\ !*** ./src/js/hk-database.js ***! @@ -242,7 +252,7 @@ eval("module.exports = __webpack_require__.p + \"img/thumbnail1200x628.jpg\";\n\ /*!*************************!*\ !*** ./src/js/index.js ***! \*************************/ -eval("/* global require */\n// CSS\n__webpack_require__(/*! ../css/fontello.css */ \"./src/css/fontello.css\");\n\n__webpack_require__(/*! ../css/simpleicon.css */ \"./src/css/simpleicon.css\");\n\n__webpack_require__(/*! ../css/style.css */ \"./src/css/style.css\"); // meta tags (social)\n\n\n__webpack_require__(/*! ../img/thumbnail1200x628.jpg */ \"./src/img/thumbnail1200x628.jpg\"); // Instantly load test file (Debugging script)\n// require(\"./LoadJson.js\");\n// Load Save File for opening files, decoding, decryption\n\n\n__webpack_require__(/*! ./LoadSaveFile.js */ \"./src/js/LoadSaveFile.js\"); // Main script for analyzing the decoded save file\n\n\n__webpack_require__(/*! ./HKCheckCompletion.js */ \"./src/js/HKCheckCompletion.js\");\n\n//# sourceURL=webpack://hollow-knight-completion-check/./src/js/index.js?"); +eval("/* global require */\n// CSS\n__webpack_require__(/*! ../css/fontello.css */ \"./src/css/fontello.css\");\n\n__webpack_require__(/*! ../css/simpleicon.css */ \"./src/css/simpleicon.css\");\n\n__webpack_require__(/*! ../css/style.css */ \"./src/css/style.css\"); // meta tags (social)\n\n\n__webpack_require__(/*! ../img/thumbnail1200x628.jpg */ \"./src/img/thumbnail1200x628.jpg\"); // Instantly load test file (Debugging script)\n// require(\"./LoadJson.js\");\n// \n\n\n__webpack_require__(/*! ./analytics.js */ \"./src/js/analytics.js\"); // Load Save File for opening files, decoding, decryption\n\n\n__webpack_require__(/*! ./LoadSaveFile.js */ \"./src/js/LoadSaveFile.js\"); // Main script for analyzing the decoded save file\n\n\n__webpack_require__(/*! ./HKCheckCompletion.js */ \"./src/js/HKCheckCompletion.js\");\n\n//# sourceURL=webpack://hollow-knight-completion-check/./src/js/index.js?"); })(); /******/ })() diff --git a/docs/index.html b/docs/index.html index 8e6000e..b908fb4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -131,11 +131,5 @@ --> - + + diff --git a/src/index.html b/src/index.html index 2094751..56c806d 100644 --- a/src/index.html +++ b/src/index.html @@ -131,11 +131,5 @@ --> - + + diff --git a/src/js/analytics.js b/src/js/analytics.js new file mode 100644 index 0000000..7a495a4 --- /dev/null +++ b/src/js/analytics.js @@ -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'); \ No newline at end of file diff --git a/src/js/index.js b/src/js/index.js index 3e6a4dd..1b4896c 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -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");