我正在尝试让 Google Analytics 与我的应用程序一起工作。
我有
将官方的 Google Analytics SDK 3 集成到我的项目中
AppDelegate.m
// Initialize the default tracker. After initialization, [GAI sharedInstance].defaultTracker
// returns this same tracker.
// TODO: Replace the tracker-id with your app one from https://www.google.com/analytics/web/
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"XX-XXXXX-X"];
// Provide unhandled exceptions reports.
[GAI sharedInstance].trackUncaughtExceptions = YES;
// Enable Remarketing, Demographics & Interests reports. Requires the libAdIdAccess library
// and the AdSupport framework.
// https://developers.google.com/analytics/devguides/collection/ios/display-features
tracker.allowIDFACollection = YES;
然后在 WordPressViewController.m
- (void) viewDidLoad
{
[super viewDidLoad];
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
@"appview", kGAIHitType, @"Home Screen", kGAIScreenName, nil];
[tracker send:params];
位码也不能以某种方式与最新的 sdk 一起工作(不知道这对跟踪器工作是否重要)
但是,当我运行应用程序转到屏幕时,实时数据不显示任何内容。