Exception stack trace in Google Analytics v2 for Android?

Stack tracing is critical for troubleshooting. On Android, you can find nice reports in the Play Store console. If you are not using Google Analytics V2. In this case, Google Analytics seems to be swallowing exceptions. Even worse, Google Analytics seems to only log the first line of the exception and thus loses the stack. At least it does not appear in the error report.

Here is a clipping from our analytics.xml:

<!-- Enable automatic exception tracking --> <bool name="ga_reportUncaughtExceptions">true</bool> <bool name="ga_debug">false</bool> 

See also here: https://developers.google.com/analytics/devguides/collection/android/v2/exceptions#easytracker

So, maybe something is missing / wrong in our application?

+8
android exception-handling google-analytics
source share
3 answers

As the previous answer (user857661) says, see the Google Analytics docs on creating a new ExceptionReporter or see my blog post on how to assign a custom ExceptionParser to the default handler.

+15
source share

If you want to see the full trace of exceptions on GA V3.0 and beyond, send your exception, for example

 String exceptionTrace = "Any custom string as well " + getExceptionDescription(Ex); EasyTracker.getInstance(context).send(MapBuilder.createException(exceptionTrace, false).build()); 
+1
source share

You can overwrite the ExceptionParser class to get additional stack information: https://developers.google.com/analytics/devguides/collection/android/v2/exceptions#exception-parser . I'm not sure stacktrace will be very readable in the google analytics web interface.

0
source share

All Articles