Warning: Never send the exception message
(such as e.getMessage()) to Google Analytics as it may contain
personally identifiable information.

Uncaught Exception Measurement

Uncaught exceptions represent instances where your app encountered
unexpected conditions at runtime and are often fatal, causing the app to
crash. Uncaught exceptions can be sent to Google Analytics automatically
by setting the ga_reportUncaughtExceptions configuration value
or by using the ExceptionReporter class.

Automatic Configuration

To send all uncaught exceptions in your app automatically to Google
Analytics, add this line to your XML configuration file:

<bool name="ga_reportUncaughtExceptions">true</bool>

After sending an exception using automatic exception measurement, the
exception will be passed on to the Thread's default exception
handler.

Note: This value can only be set to
true for a single Tracker. If specified for multiple Trackers,
then the last one to be initialized will be used.

Using an Advanced Implementation

Use the ExceptionReporter class to implement automatic
uncaught exception measurement if you're using an advanced implementation and
not using the ga_reportUncaughtExceptions configuration value.

ExceptionReporter can serve as the default uncaught exception
handler for either a specific thread or all threads in your app. After sending
an exception to Google Analytics, the ExceptionReporter class can
optionally pass the exception on to an uncaught exception handler you
provide.

The following code creates a new ExceptionReporter object and
sets it as the new default uncaught exception handler. As a result, every
uncaught exception will be sent to Google Analytics and then passed on to the
previous uncaught exception handler. For most applications, the default handler
will log the exception to the log and terminate the application.