]> arthur.barton.de Git - netdata.git/blobdiff - web/index.html
fix width of demosites.html; added google analytics to demosites.html and index.html...
[netdata.git] / web / index.html
index 19b3f8ef48170d06ed41ba823781b433fed9c8ab..507fd7a308ba259c7819e3435fba6eda748d8339 100644 (file)
@@ -2007,17 +2007,30 @@ function finalizePage() {
                        location.reload();
        });
 
-       if(!nowelcome && isdemo()) {
-               setTimeout(function() {
-                       $('#welcomeModal').modal();
-               }, 1000);
-       }
-       else
-               notifyForUpdate();
-
        $('#updateModal').on('shown.bs.modal', function() {
                notifyForUpdate(true);
        });
+
+       if(isdemo()) {
+               if(!nowelcome) {
+                       setTimeout(function() {
+                               $('#welcomeModal').modal();
+                       }, 1000);
+               }
+
+               // google analytics when this is used for the home page of the demo sites
+               // this does not run on user's installations
+               setTimeout(function() {
+                       (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+                       (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+                       m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+                       })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+                       ga('create', 'UA-64295674-3', 'auto');
+                       ga('send', 'pageview');
+               }, 2000);
+       }
+       else notifyForUpdate();
 }
 
 function resetDashboardOptions() {