Last active
November 28, 2016 08:18
-
-
Save deguchi/4583299 to your computer and use it in GitHub Desktop.
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
window.onerror = function(mes,file,num){ | |
track_jserror(mes,file,num); | |
return false; | |
} | |
function track_jserror(mes,file,num){ | |
if("_gaq" in window){ | |
_gaq.push(['_trackEvent', 'Javascript', 'Error', [ | |
"file : " + file, | |
"line : " + num, | |
"message : " + mes | |
].join(" ")]); | |
}else{ | |
setTimeout(function(){ | |
track_jserror(mes,file,num); | |
}, 1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment