UI errors tracking with Google Analytics

#1

I’m trying to track un-catched UI errors with google analytics as follows:

window.addEventListener("error", function (e) {
  ga('send', 'exception', {
    'exDescription': e.error.message,
    'exFatal': false
  });
  return false;
})

Is this a good idea? are there a recommendations for a better way?

0 Likes