window._paq = window._paq || ; window._paq.push(['enableJSErrorTracking']);
Once you enable JS error tracking, JS errors will be tracked as Events and appear in the Behavior > Events report. Events will have the following details:
- Event category =
- Event action = the URL of the page where the error occured, with the line number appended (and the character column number)
- Event name = the error message as it appears in your visitors’ browser’s console (developer tools)
So when you open the Event Names report, you can click on the error message to see the page URL(s) on which the error occurred.
- currently the stack trace is not recorded, which makes it sometimes harder to troubleshoot.
- the same error will be only tracked once per page view. If the very same error is happening multiple times, then it will be tracked only once within the same page view. If another page view is tracked or when the page reloads, then the error will be tracked again.