[iOS] For Exception Tracking in Google Analytics 2.0, Use trackUncaughtExceptions = YES

Tadashi Shigeoka ·  Wed, July 17, 2013

Here’s a memo on how to track exceptions with Google Analytics 2.0 in iOS app development.

The official documentation mentions sendUncaughtExceptions, but that doesn’t exist. (Did it exist before?)

Crashes & Exceptions - iOS SDK - Google Analytics — Google Developers

As you can see by checking the source code, when configuring exception tracking in Google Analytics, specify trackUncaughtExceptions = YES.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GAI sharedInstance].trackUncaughtExceptions = YES; // Enable 

  // ... the rest of your code, include other GAI properties you want to set.
}

The documentation is included with the SDK files, so check that instead.

Downloads - iOS SDK - Google Analytics — Google Developers

That’s all from the Gemba.