repo: janusweb action: commit revision: path_from: revision_from: 4135850020071d7ce073f6df76b1f6381450503d: path_to: revision_to:
commit 4135850020071d7ce073f6df76b1f6381450503d Author: James BaicoianuDate: Fri Apr 15 04:37:53 2016 -0700 Error tracking diff --git a/scripts/tracking.js b/scripts/tracking.js
--- 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-----