- スクリーンビューをGA_TRACK_VIEWで
- 細かい機能ごとのデータをとりたいときはEVENTで
- どのページを見ているかなどのデータは、CUSTOM DIMENSIONを使って保存している
#import "GAI.h"
#import "GAIFields.h"
#import "GAIDictionaryBuilder.h"
#define GA_TRACK_VIEW(PAGE) [[[GAI sharedInstance] defaultTracker] send:[[[GAIDictionaryBuilder createAppView] set:PAGE forKey:kGAIScreenName] build]];
#define GA_TRACK_VIEW_WITH_CUSTOM1(PAGE, CUSTOM) [[[GAI sharedInstance] defaultTracker] send:[[[[GAIDictionaryBuilder createAppView] set:PAGE forKey:kGAIScreenName] set:CUSTOM forKey:[GAIFields customDimensionForIndex:1]] build]];
#define GA_TRACK_EVENT(EVENT,ACTION,LABEL,VALUE) [[[GAI sharedInstance] defaultTracker] send:[[GAIDictionaryBuilder createEventWithCategory:EVENT action:ACTION label:LABEL value:VALUE] build]];
#define GA_TRACK_TIMING(CATEGORY,TIME,NAME,LABEL) [[GAI sharedInstance] defaultTracker] send:[GAIDictionaryBuilder createTimingWithCategory:CATEGORY interval:TIME name:NAME label:LABEL] build];
#define GA_TRACK_SOCIAL(NETWORK,ACTION,TARGET) [[[GAI sharedInstance] defaultTracker] send:[GAIDictionaryBuilder createSocialWithNetwork:NETWORK action:ACTION target:TARGET] build];
#define GA_TRACK_CLASS GA_TRACK_VIEW(NSStringFromClass([self class]));
参考
http://d.hatena.ne.jp/diveintounlimit/20120922/1348316659