matomo-org / matomo-java-tracker

Official Java implementation of the Matomo Tracking HTTP API.
https://matomo-org.github.io/matomo-java-tracker/
BSD 3-Clause "New" or "Revised" License
69 stars 52 forks source link

Add support for new Crash Analytics feature #131

Closed tsteur closed 1 year ago

tsteur commented 1 year ago

To support Matomo's new Crash Analytics feature, we'd like to add crash tracking methods in all supported tracking SDKs.

The tracking methods should be similar to the PHP SDK's methods:

public function trackPhpThrowable(\Throwable $ex, $category = false); // deduces as much information as possible

public function trackCrash($message, $type, $category, $stack, $location, $line, $column); // user supplies all information

trackCrash() passes its parameters as the following HTTP API parameters:

IMPORTANT It must also pass ca=1 (stands for 'custom action') as a parameter so if the plugin is deactivated in Matomo, nothing will be tracked.

trackPhpThrowable (or the equivalent method for the language of this SDK) should accept an exception object and deduce set the crash tracking parameters based on it. The type should be set to the exception class name or something similar.

See also the implementation in the PHP tracker:

Please let me know if there are any questions.

dheid commented 1 year ago

I added the crash parameters. We will implement custom tracking methods like in the PHP tracker in the future.

dheid commented 1 year ago

@tsteur I added a new ticket for the track methods similar to the Matomo PHP tracker: https://github.com/matomo-org/matomo-java-tracker/issues/156

tsteur commented 1 year ago

Awesome, thanks so much @dheid 🎉

dheid commented 1 year ago

@tsteur Your welcome. Could you look at my PR please? https://github.com/matomo-org/developer-documentation/pull/767

tsteur commented 1 year ago

Thanks @dheid . I requested a review of the core team for the documentation