5 // Created by Matthew Newberry on 05/18/11.
6 // The OpenStack project is provided under the Apache 2.0 license.
10 #import <objc/runtime.h>
12 void TrackEvent(NSString *category, NSString *action){
14 [[GANTracker sharedTracker] trackEvent:category action:action label:nil value:-1 withError:nil];
17 void TrackViewController(UIViewController *vc){
21 NSMutableString *className = [NSMutableString stringWithUTF8String:class_getName([vc class])];
22 [className replaceOccurrencesOfString:@"ViewController" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [className length])];
23 [className insertString:@"/" atIndex:0];
25 [[GANTracker sharedTracker] trackPageview:className withError:&error];
28 void DispatchAnalytics(){
29 # if (!TARGET_IPHONE_SIMULATOR)
30 [[GANTracker sharedTracker] dispatch];