summaryrefslogtreecommitdiffstats
path: root/web/gui/dashboard.js
diff options
context:
space:
mode:
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 7ba8c522..49357a32 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);