Google Analytics for iOS,未在Google方面接收数据

时间:2015-09-24 02:27:02

标签: ios objective-c google-analytics

我正在尝试在我的iOS应用中实现GA。在我的Xcode控制台中,我看到来自GA系统的大量消息,这些消息都显示成功跟踪我的屏幕视图,但我的Google Analytics帐户/属性中的实时概览中从未显示任何内容。

以下是我经历的步骤:

1)通过pod安装GoogleAnalytics

2)配置了Google服务项目,并通过https://developers.google.com/mobile/add为我的应用添加了Google Analytics(分析)

3)为我生成了GoogleService-Info.plist,我将其添加到了我的项目中。

4)我在AppDelete中配置了GAI:

GAI *gai = [GAI sharedInstance];
gai.trackUncaughtExceptions = YES;
gai.logger.logLevel = kGAILogLevelVerbose;
gai.dispatchInterval = 5;

5)接下来,我配置了View Controller来跟踪屏幕视图:

- (NSString*) gaiScreenName {
    return NSStringFromClass([self class]);
}

- (void) gaiLogScreenView {
    id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
    [tracker set:kGAIScreenName value:[self gaiScreenName]];
    [tracker send:[[GAIDictionaryBuilder createScreenView] build]];
}

- (void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [self gaiLogScreenView];
}

在我的控制台中,看起来一切正常:

2015-09-23 18:59:23.595 MyAppName[370:206928] VERBOSE: GoogleAnalytics 3.13 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:517): Saved hit: {
    parameters =     {
        "&_crc" = 0;
        "&_s" = 15;
        "&_u" = ".oK9L";
        "&_v" = "mi3.1.3";
        "&a" = 23452345;
        "&aid" = "com.inadaydevelopment.myappid";
        "&an" = MyAppName;
        "&av" = "1.1";
        "&cd" = ViewAnimalViewController;
        "&cid" = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx";
        "&dm" = "iPhone7,2";
        "&ds" = app;
        "&sr" = 640x1136;
        "&t" = screenview;
        "&tid" = "UA-XXXXXXX-2";
        "&ul" = en;
        "&v" = 1;
        "&z" = 1234123412341234;
        gaiVersion = "3.13";
    };
    timestamp = "2015-09-24 01:59:23 +0000";
}
2015-09-23 18:59:25.199 MyAppName[370:206928] VERBOSE: GoogleAnalytics 3.13 -[GAIRequestBuilder requestPostUrl:payload:compression:] (GAIRequestBuilder.m:167): building URLRequest for https://ssl.google-analytics.com/batch
2015-09-23 18:59:25.200 MyAppName[370:206928] VERBOSE: GoogleAnalytics 3.13 -[GAIBatchingDispatcher dispatchWithCompletionHandler:] (GAIBatchingDispatcher.m:632): Sending hit(s) POST: https://ssl.google-analytics.com/batch
2015-09-23 18:59:25.492 MyAppName[370:206887] INFO: GoogleAnalytics 3.13 -[GAIBatchingDispatcher didSendHits:response:data:error:] (GAIBatchingDispatcher.m:226): Hit(s) dispatched: HTTP status 200

但是,我从未在Google Analytics的报告中看到任何数据。我已经确认我正在查看正确的帐户/媒体资源/视图。

我错过了什么或做错了什么?

2 个答案:

答案 0 :(得分:3)

考虑到您必须等待大约24小时才能让统计数据开始显示在控制面板上。这仅适用于初始加载,在此延迟之后,统计信息将立即显示。

如果在24小时后你仍然看不到任何东西,那么肯定会出现问题。

答案 1 :(得分:0)

在我的情况下,实时视图显示大约2分钟后的数据,不需要等待24小时。所以我认为@Kenny Wyland,您应该尝试实时查看数据。如果你看不到,可能你的GAI将在明天看不到数据。