Question

My application crashes with very poor info. Is there a way that I could find the last screen name, in google analytics, when application crashes? I am tracking every screen in my application. This way I could know in what controller the bug exists. Thanks for any help!

Edit Crash report:

NSRangeException Trace: <redacted> <redacted> <redacted> <redacted> <redacted> <redacted> <redacted> <redacted> <redacted> CFRunLoopRunSpec
Was it helpful?

Solution 2

Have you tried the Crash and Exception Analysis in GA?

You can find more details about the analysis here: https://developers.google.com/analytics/devguides/collection/ios/v2/exceptions

Examples of tracking code from the page:

@try {
  NSArray *highScores = [self getHighScores];
}
@catch (NSException *exception) {
    [tracker sendException:NO // Boolean indicates non-fatal exception.
            withDescription:@"Connection timout %d: %@", connectionError, errorDescription];
}

and automatic tracking for uncaught exceptions:

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

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

OTHER TIPS

I came across a similar situation using Google Analytics with my app. I was able to get more information from the Crashes and Exceptions page that shows all the errors by clicking on Secondary Dimension -> Engagement -> Screen Name. This shows the screen where the crash/error occurred.

I faced similar issue and came across with a multi tier solution : Google Analytics provides two-way exception mechanism.

1-> manual tracking :

@try {
  NSArray *myArray = [self getListOfStudents];
}
@catch (NSException *exception) {
    [tracker sendException:NO // Boolean indicates non-fatal exception.
            withDescription:@"Unable to connect %d: %@", connectionError, errorDescription];
}

2-> Automatic tracking :

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

  // ... rest follows here.
}

Hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top