This library assumes that you are using Google Analytics for tracking page views and other events on your web application. For more information on how to setup google analytics, refer to documentation at https://developers.google.com/analytics/devguides/collection/gajs/
To setup google analytics tracking for unhandled errors,
- Include the js-watson.js file in your page(s)
window.onerror = JsWatson.trackUnhandledError
- That's it.
Now, any unhandled errors on your web pages should get reported to your google analytics account as a page view, with the script file name and the line number on which the error occured as part of the page view URL.
Over time, you can see the trends, which browsers are getting the errors, etc. There is much more to how you can analyze where errors are occuring, using the full power of google analytics.
First, ensure you're google analytics setup is otherwise properly configured and is already reporting page views and other events to google.