diff --git a/app/initializers/tracker.js b/app/initializers/tracker.js index 9b9f6b58..618a0d5b 100644 --- a/app/initializers/tracker.js +++ b/app/initializers/tracker.js @@ -1,52 +1,39 @@ // By adding track.js via javascript we can control it better. export default { - name: 'trackjs', + name: 'raygun', initialize: function (container, application) { // Clear out the old embedded version linked to from index.html - window.trackJs = null; + window.Raygun = null; // Track hosted errors only - if (window.ENV.isDevelopment || window.ENV.selfHosted) { + /*if (window.ENV.isDevelopment || window.ENV.selfHosted) { return; - } - - // Figure out path to static assets - var trackerPath = (function () { - var links = document.getElementsByTagName('link'), - leafletRe = /[\/^]app[\-\._]?([\w\-\._]*)\.css\??/; - - var i, len, href, matches, path; - - for (i = 0, len = links.length; i < len; i++) { - href = links[i].href; - matches = href.match(leafletRe); - - if (matches) { - path = href.split(leafletRe)[0]; - return (path ? path + '/' : '') + 'javascript/tracker.js'; - } - } - }()); + }*/ application.deferReadiness(); - window._trackJs = { - token: '2ec590caf8d5471a9514fd30e698cea6' - }; - (function(d, script) { script = d.createElement('script'); script.type = 'text/javascript'; script.async = true; + script.crossOrigin = true; script.onload = function(){ + if(window.Raygun) { + Raygun.init('wsX+OdSk4B61TUjygEwg1Q==', { + allowInsecureSubmissions: true, + ignoreAjaxAbort: true, + ignore3rdPartyErrors: false, + wrapAsynchronousCallbacks: true + }).attach(); + } application.advanceReadiness(); }; script.onerror = function(){ application.advanceReadiness(); }; - script.src = trackerPath; + script.src = 'http://cdn.raygun.io/raygun4js/raygun.min.js'; d.getElementsByTagName('head')[0].appendChild(script); }(document)); diff --git a/app/views/error.js b/app/views/error.js new file mode 100644 index 00000000..6f93dc41 --- /dev/null +++ b/app/views/error.js @@ -0,0 +1,7 @@ +export default Ember.View.extend({ + didInsertElement: function () { + if(window.Raygun) { + window.Raygun.send(this.controller.model); + } + }, +});