repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 4135850020071d7ce073f6df76b1f6381450503d:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 4135850020071d7ce073f6df76b1f6381450503d
Author: James Baicoianu 
Date:   Fri Apr 15 04:37:53 2016 -0700

    Error tracking

diff --git a/scripts/tracking.js b/scripts/tracking.js
index ca6c3c7a0b1f53a345ee6586e5263834da78325f..
index ..bd88cde8aa1dd33f834b9a6d21a6adf4ff5877c1 100644
--- a/scripts/tracking.js
+++ b/scripts/tracking.js
@@ -113,12 +113,18 @@ var el = document.pointerLockElement || document.mozPointerLockElement
       }, 1000);

       // report FPS every 15 seconds
-      setInterval(function() {
-        var fpstxt = document.getElementById('fpsText').innerHTML; 
-        var fps = fpstxt.substr(0, fpstxt.indexOf(' '))
-        ga('send', 'event', 'engine', 'fps', fps);
-      }, 15000);
+      var stats = document.getElementById('fpsText');
+      if (stats) {
+        setInterval(function() {
+          var fpstxt = document.getElementById('fpsText').innerHTML; 
+          var fps = fpstxt.substr(0, fpstxt.indexOf(' '))
+          ga('send', 'event', 'engine', 'fps', fps);
+        }, 15000);
+      }

     });
+    elation.events.add(window, 'error', function(msg) {
+      ga('send', 'event', 'client', 'error', msg);
+    });
   }
 });

-----END OF PAGE-----