summaryrefslogtreecommitdiffstats
path: root/web/gui/dashboard.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-17 17:57:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-17 17:57:47 +0000
commit1d63948d79ca6f32889656692d6736c9127f2ee1 (patch)
treebb26a34d7c7b62ac30b0d4da15584efe3e2a754a /web/gui/dashboard.js
parentReleasing debian version 1.13.0-1. (diff)
downloadnetdata-1d63948d79ca6f32889656692d6736c9127f2ee1.tar.xz
netdata-1d63948d79ca6f32889656692d6736c9127f2ee1.zip
Merging upstream version 1.14.0~rc0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/gui/dashboard.js')
-rw-r--r--web/gui/dashboard.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/web/gui/dashboard.js b/web/gui/dashboard.js
index 7ba8c522e..49357a32d 100644
--- a/web/gui/dashboard.js
+++ b/web/gui/dashboard.js
@@ -9698,7 +9698,7 @@ NETDATA.registry = {
machines: null, // the user's other URLs
machines_array: null, // the user's other URLs in an array
person_urls: null,
-
+ anonymous_statistics_checked: false,
MASKED_DATA: "***",
isUsingGlobalRegistry: function() {
@@ -9771,8 +9771,16 @@ NETDATA.registry = {
}
NETDATA.registry.machine_guid = data.machine_guid;
NETDATA.registry.hostname = data.hostname;
- if (dataLayer) {
- if (data.anonymous_statistics) dataLayer.push({"anonymous_statistics" : "true", "machine_guid" : data.machine_guid});
+ if (!NETDATA.registry.anonymous_statistics_checked) {
+ NETDATA.registry.anonymous_statistics_checked=true;
+ if (data.anonymous_statistics) {
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=false;j.src=
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
+ })(window,document,'script','dataLayer','GTM-N6CBMJD');
+ dataLayer.push({"anonymous_statistics" : "true", "machine_guid" : data.machine_guid});
+ }
}
NETDATA.registry.access(2, function (person_urls) {
NETDATA.registry.parsePersonUrls(person_urls);