Skip to content

Instantly share code, notes, and snippets.

@rbaulin
Last active August 29, 2015 14:17
Show Gist options
  • Save rbaulin/63fd44a4c4e4acdfe717 to your computer and use it in GitHub Desktop.
Save rbaulin/63fd44a4c4e4acdfe717 to your computer and use it in GitHub Desktop.
// crash and exceptions in google analytics are stripped and all wrong
// but action and label can be delivered in full length
//
// send formatted string w/o params in action (as unique error name)
// will show up count in realtime dashboard under category err
//
// send formatted string w/ params in label (as error description)
// can be inspected and queryied in behaviour -> events -> overview -> err
//
// sample: TRACK_ERR(@"audiosession error %@", error)
// sample: TRACK_ERR(@"bad filetype %@ %@", fileType, fileName)
#define TRACK_ERR(fmt, ...) [[[GAI sharedInstance] defaultTracker] send:[[GAIDictionaryBuilder createEventWithCategory:@"err" action:fmt label:[NSString stringWithFormat:@"" fmt, ##__VA_ARGS__] value:nil] build]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment