Skip to content

Instantly share code, notes, and snippets.

@kaylarose
Created February 22, 2014 01:51
Show Gist options
  • Save kaylarose/9147448 to your computer and use it in GitHub Desktop.
Save kaylarose/9147448 to your computer and use it in GitHub Desktop.
Google Analytics Snippets
// Pre-(psuedo) "Symbolicated" Crash Reports
id tracker = [[GAI sharedInstance] defaultTracker];
NSString * model = [[UIDevice currentDevice] model];
NSString * version = [[UIDevice currentDevice] systemVersion];
NSArray * backtrace = [exception callStackSymbols];
NSString * description = [NSString stringWithFormat:@"%@.%@.%@.Backtrace:%@",
model,
version,
exception.description,
backtrace];
[tracker send:[[GAIDictionaryBuilder
createExceptionWithDescription:description // Exception description. May be truncated to 100 chars.
withFatal:NO] build]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment