Google Analytics for Mobile Apps iOS SDK v3事件跟踪

时间:2013-08-18 13:50:04

标签: ios google-analytics

我正在使用Google Analytics for Mobile Apps iOS SDK v3。屏幕跟踪工作正常,但我不能让事件跟踪工作。 Xcode显示错误:

No known class method for selector 'createEventWithCategory:withAction:withLabel:withValue:'

我的代码是:

- (IBAction)callButton:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:12345"]];
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];    
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"ui_action"
                                                  withAction:@"button_press"
                                                   withLabel:@"play_button"
                                                   withValue:nil] build]];
}

1 个答案:

答案 0 :(得分:3)

尝试:

[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"ui_action"
                                                      action:@"button_press"
                                                       label:@"play_button"
                                                       value:nil] build]];