Created
December 15, 2014 10:39
-
-
Save suwa-yuki/15952e16c53c6ab79569 to your computer and use it in GitHub Desktop.
Google AnalyticsをUIViewControllerで使う
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation UIViewController (Analytics) | |
- (void)startScreen:(NSString*)screenName | |
{ | |
// Google Analytics | |
id tracker = [[GAI sharedInstance] defaultTracker]; | |
[tracker set:kGAIScreenName value:screenName]; | |
[tracker send:[[GAIDictionaryBuilder createAppView] build]]; | |
} | |
- (void)sendGaiEvent:(NSString *)category action:(NSString *)action label:(NSString *)label value:(NSNumber *)value | |
{ | |
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker]; | |
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:category | |
action:action | |
label:label | |
value:value] build]]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment