diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:35 +0000 |
commit | 3b95e5be69c199a2a195c57aba12d88c242225ac (patch) | |
tree | 137b72ffaefe7f34bf21e975ccc9cc9ec0474564 /web/gui/src/dashboard.js/registry.js | |
parent | Adding upstream version 1.13.0. (diff) | |
download | netdata-b9ac22f8da656f8703bea7c713068a397e01c714.tar.xz netdata-b9ac22f8da656f8703bea7c713068a397e01c714.zip |
Adding upstream version 1.14.0~rc0.upstream/1.14.0_rc0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/gui/src/dashboard.js/registry.js')
-rw-r--r-- | web/gui/src/dashboard.js/registry.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/web/gui/src/dashboard.js/registry.js b/web/gui/src/dashboard.js/registry.js index 7894eaa21..090ef52fd 100644 --- a/web/gui/src/dashboard.js/registry.js +++ b/web/gui/src/dashboard.js/registry.js @@ -11,7 +11,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() { @@ -84,8 +84,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); |