我刚刚在Google Analytics上添加了一个应用来测试SDK和报告。但我无法看到会议。我已经关注了google's implementation guid.
我添加了所需的框架,初始化了跟踪器。这是我的application:didFinishLaunchingWithOptions:
方法:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Optional: automatically send uncaught exceptions to Google Analytics.
[GAI sharedInstance].trackUncaughtExceptions = YES;
// Optional: set Google Analytics dispatch interval to e.g. 20 seconds.
[GAI sharedInstance].dispatchInterval = 2;
// Optional: set Logger to VERBOSE for debug information.
[[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];
// Initialize tracker. Replace with your tracking ID.
[[GAI sharedInstance] trackerWithTrackingId:@"UA-56974161-1"];
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
tracker.allowIDFACollection = YES;
return YES;
}
我已在ViewController
:
- (void)viewDidLoad {
[super viewDidLoad];
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Played" // Event category
action:@"Pressed" // Event action
label:@"Finish" // Event label
value:nil] build]]; // Event value
// Enable Advertising Features.
tracker.allowIDFACollection = YES;
[tracker set:kGAIScreenName value:@"BarrenFields"];
[tracker send:[[[GAIDictionaryBuilder createScreenView]
set:@"Barren Fields"
forKey:[GAIFields customDimensionForIndex:1]] build]];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
@"appview", kGAIHitType, @"Home Screen", kGAIScreenName, nil];
[tracker send:params];
// Do any additional setup after loading the view, typically from a nib.
}
现在可能是我错过了什么。任何人都可以搞清楚吗?