Skip to content

Instantly share code, notes, and snippets.

@shfx
Created November 14, 2013 12:27
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shfx/7465965 to your computer and use it in GitHub Desktop.
Save shfx/7465965 to your computer and use it in GitHub Desktop.
window.onerror = function(message, url, linenumber) {
try{
_gaq.push(['_trackEvent', 'Error', 'JS', JSON.stringify({'refurl': document.location.href, 'url': url.replace(/\?\d+$/, ''), 'line': linenumber, 'message': message})]);
} catch (e) {}
return true;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment