mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-04 05:58:09 +02:00
GA-based js error logging. Fixes #660 for the time being.
This commit is contained in:
+11
@@ -182,7 +182,18 @@ _gaq.push(['_trackPageview']);
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
|
||||
// javascript errors
|
||||
var lastev = '';
|
||||
window.onerror = function(message, file, lineNumber) {
|
||||
var ev = ['_trackEvent', 'error', file + ':' + lineNumber, message + ''];
|
||||
if (ev.join(',') !== lastev) {
|
||||
_gaq.push(ev);
|
||||
lastev = ev.join(',');
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
</script>
|
||||
|
||||
<!-- crazyegg -->
|
||||
|
||||
Reference in New Issue
Block a user