jrobinsonc
8/30/2017 - 7:20 PM

Handling JavaScript errors with Google Analytics

Handling JavaScript errors with Google Analytics

// https://developers.google.com/analytics/devguides/collection/analyticsjs/exceptions
window.onerror = function(errorMsg, url, line, lineColumn, errorObj) {
  ga('send', 'exception', {
    'errorMsg': errorMsg,
    'url': url,
    'line': line,
    'lineColumn': lineColumn,
    'errorObj': JSON.stringify(errorObj)
  });
};