party-mode icon indicating copy to clipboard operation
party-mode copied to clipboard

add analytics for clientside js errors

Open fulldecent opened this issue 10 years ago • 2 comments

A phonehome with information to help with debugging

fulldecent avatar Oct 12 '15 14:10 fulldecent

This is really simple:

// Track basic JavaScript errors
window.addEventListener('error', function(e) {
    _gaq.push([
        '_trackEvent',
        'JavaScript Error',
        e.message,
        e.filename + ':  ' + e.lineno,
        true
    ]);
});

// Track AJAX errors (jQuery API)
$(document).ajaxError(function(e, request, settings) {
    _gaq.push([
        '_trackEvent',
        'Ajax error',
        settings.url,
        e.result,
        true
    ]);
});

https://davidwalsh.name/track-errors-google-analytics

fulldecent avatar Jun 24 '16 17:06 fulldecent

Would a PR that fixes this be in scope to be merged?

fulldecent avatar Feb 28 '18 02:02 fulldecent