Skip to content

Instantly share code, notes, and snippets.

@simondahla
Last active October 18, 2018 14:31
Show Gist options
  • Save simondahla/9387697 to your computer and use it in GitHub Desktop.
Save simondahla/9387697 to your computer and use it in GitHub Desktop.
A Poor Man's Javascript Error Logger using Google Analytics
window.onerror = function(message, file, line) {
if (typeof(ga) !== "undefined") {
ga('send', 'event', 'Global', 'Exception', file + "(" + line + "): " + message);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment