Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception stack trace lost in Google Analytics v2 for Android?

The stack trace is crucial to fix problems. In Android you can find nice reports in the Play store console. Unless you use Google Analytics V2. In this case Analytics seems to swallow the exceptions. Worse, Analytics seems to log only the first line of the exception and thus loosing the stacktrace. At least it is not shown in the error report.

Here's a snip 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, could there be something missing/wrong in our app?

like image 746
Markus Junginger Avatar asked Dec 23 '12 09:12

Markus Junginger


2 Answers

As 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 into the default handler.

like image 182
Dan Dar3 Avatar answered Nov 14 '22 23:11

Dan Dar3


If you want to see complete exception trace on GA V3.0 onwards, send your exception like

String exceptionTrace = "Any custom string as well " + getExceptionDescription(Ex);    
EasyTracker.getInstance(context).send(MapBuilder.createException(exceptionTrace, false).build());
like image 34
Pawan Maheshwari Avatar answered Nov 14 '22 22:11

Pawan Maheshwari