summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorChris Akritidis <43294513+cakrit@users.noreply.github.com>2019-01-27 12:35:09 +0200
committerGitHub <noreply@github.com>2019-01-27 12:35:09 +0200
commit2a5074ad432f41b942bdee845975b4d8ec527361 (patch)
tree8122ef6b231b9dd46cefba55cef0fc5fa3613d76 /web
parentd5e1197de6c8dcacfdaab1f99a83db450ecbe675 (diff)
Anonymous statistics (#5113)
* Added shell and dashboard anonymous statistics * Check for environment var NETDATA_REGISTRY_UNIQUE_ID * Fix indentation * Removed health-cmdapi-test * docs/anonymous-statistics.md
Diffstat (limited to 'web')
-rw-r--r--web/gui/dashboard.js2
-rw-r--r--web/gui/index.html7
-rw-r--r--web/gui/src/dashboard.js/registry.js2
3 files changed, 9 insertions, 2 deletions
diff --git a/web/gui/dashboard.js b/web/gui/dashboard.js
index 94cdb75e32..d066da2f52 100644
--- a/web/gui/dashboard.js
+++ b/web/gui/dashboard.js
@@ -9742,7 +9742,7 @@ NETDATA.registry = {
NETDATA.registry.cloudBaseURL = data.cloud_base_url;
NETDATA.registry.machine_guid = data.machine_guid;
NETDATA.registry.hostname = data.hostname;
-
+ if (data.anonymous_statistics) dataLayer.push({"anonymous_statistics" : "true", "machine_guid" : data.machine_guid});
NETDATA.registry.access(2, function (person_urls) {
NETDATA.registry.parsePersonUrls(person_urls);
diff --git a/web/gui/index.html b/web/gui/index.html
index 635038458a..8cae72c51a 100644
--- a/web/gui/index.html
+++ b/web/gui/index.html
@@ -2,6 +2,13 @@
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
<html lang="en">
<head>
+ <script>(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=true;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" : "false"});
+ </script>
<title>netdata dashboard</title>
<meta name="application-name" content="netdata">
diff --git a/web/gui/src/dashboard.js/registry.js b/web/gui/src/dashboard.js/registry.js
index b0e893e0cf..5ef83bed0a 100644
--- a/web/gui/src/dashboard.js/registry.js
+++ b/web/gui/src/dashboard.js/registry.js
@@ -68,7 +68,7 @@ NETDATA.registry = {
NETDATA.registry.cloudBaseURL = data.cloud_base_url;
NETDATA.registry.machine_guid = data.machine_guid;
NETDATA.registry.hostname = data.hostname;
-
+ if (data.anonymous_statistics) dataLayer.push({"anonymous_statistics" : "true", "machine_guid" : data.machine_guid});
NETDATA.registry.access(2, function (person_urls) {
NETDATA.registry.parsePersonUrls(person_urls);