bitstadium / HockeySDK-Cordova

HockeyApp was retired and the SDKs are deprecated. Please use App Center instead.
https://github.com/microsoft/appcenter-sdk-cordova
Other
82 stars 73 forks source link

TrackEvent with details #80

Closed piwnik closed 4 years ago

piwnik commented 7 years ago

HockeyMetrics.MetricsManager.TrackEvent have overloaded method with event properties and measurements

public void TrackEvent(string eventName, Dictionary<string, string> properties, Dictionary<string, double> measurements);

It will be handy to add more info about event. For example override console.error function to catch crashes in JavaScript and publish such event with error details.

ElektrojungeAtWork commented 7 years ago

Hey @piwnik,

thanks for getting in touch. We currently don't have plans to add another overload to the method. I'm very interested in your use-case though. Which info are you missing? From what you are writing, it sounds like you want some kind of "error"-event to track non-fatal errors within the app.

Best, Benjamin

piwnik commented 7 years ago

Hi @TroubleMakerBen,

yes, you are right, I want to track fatal, non-fatal errors (warnings) in JavaScript. As I understand, hockeyapp, now supports only native crashes, but I want handle JavaScript fails/errors/warnings also. As I said currently I can override/wrap console.error and in error case publish some event to hockeyapp (for example APPLICATION_FATAL_ERROR), but I want to add some more info to this event such error message, stack trace. In ideal situation will be very nice to have possibility for register crash from JavaScript. Of course I probably can use addMetaData method and then forceCrash application, but this is not really what I want to do, because I can refresh application to restore it state without user interaction and application relaunch. And of course this is not case for warnings handling. As an example I have some kind of synchronization system, sometimes it fails (no connection, corrupted data, server side fail or something else) to synchronize and I want to track such errors, synchronization fail isn't fatal error and I can try synchronize later, but I still want to know what cause error. In this case I need more information than just error/warning event name, but also some details, what exactly was wrong.

So in general what do you think about errors/warnings events with extra information raised/registered from JavaScript?

ElektrojungeAtWork commented 7 years ago

I think your use-case is valid and it has been on our minds for a while, actually. That said, it's not very likely to happen for the HockeySDK. We are hard at work for Mobile Center and while the work for a Cordova SDK hasn't been planned yet, Mobile Center will get support for Cordova eventually. Mobile Center doesn't have support for error tracking right now, but it's definitely on the backlog. So, if error tracking is gonna happen, it's gonna happen in Mobile Center.