Created
August 3, 2011 14:52
-
-
Save googleanalyticsresoneo/1122816 to your computer and use it in GitHub Desktop.
JS Exceptions tracked in GA Events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trackErrorThroughEvent(exception, fct) { /* remontée des erreurs éventuelles pour détection des pbs */ | |
_gaq.push(['_trackEvent', 'Erreur JS ' + (fct || 'native'), exception + ' name: ' + (exception.name || 'Error') + ' #mess: ' + (exception.message || 'n/a') + ' #nav: ' + navigator.userAgent , ' #url: ' + document.location.href + '#ref: ' + document.referrer ,,true ]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment