iOS 上的 Google Analytics:未跟踪事件 [英] Google Analytics on iOS: events not tracked

查看:29
本文介绍了iOS 上的 Google Analytics:未跟踪事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 Google 指南中提供的说明将 Google Analytics SDK 添加到我的项目中.但是,当我尝试跟踪某些事件时,这是调试输出:

I added Google Analytics SDK to my project, following the provided instructions on the guide by Google. However, when I try to track some events, this is the debug output:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    […]

    // Google Analytics
    [GAI sharedInstance].trackUncaughtExceptions = YES;
    [GAI sharedInstance].dispatchInterval = 20;
    [[[GAI sharedInstance] logger] setLogLevel:(PADEV ? kGAILogLevelVerbose : kGAILogLevelError)];
    [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXXXXXX-Y"]; // This is obviously replaced with my tracking ID

    return YES;
}

id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"article"
                                                      action:@"read"
                                                       label:@""
                                                       value:self.post[@"id"]] build]];

日志:

2014-11-12 01:02:25.144 PonzApp[5236:112706] INFO: GoogleAnalytics 3.10 -[GAIBatchingDispatcher didSendHits:response:data:error:] (GAIBatchingDispatcher.m:208): Hit(s) dispatched: HTTP status -1
2014-11-12 01:02:25.146 PonzApp[5236:112781] INFO: GoogleAnalytics 3.10 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:509): hit(s) Successfully deleted
2014-11-12 01:02:25.147 PonzApp[5236:112781] INFO: GoogleAnalytics 3.10 -[GAIBatchingDispatcher didSendHits:] (GAIBatchingDispatcher.m:219): 1 hit(s) sent

它说命中已发送,但 HTTP 状态很奇怪 -1,如果我检查仪表板的实时"部分,则什么也没有出现.

It says that the hits are sent but the HTTP status is weirdly -1 and if I check on the dashboard, section "real-time", nothing appears.

可能有什么问题?

推荐答案

来自 Google Analytics 跟踪设置

From Google Analytics tracking setup

一旦您正确安装了跟踪代码段,您应该最多允许 24 小时数据出现在您的帐户中.如果有已超过 24 小时,但您仍未看到任何数据,请执行查看以下可能的原因列表:

Once you've correctly installed the tracking code snippet, you should allow up to 24 hours for data to appear in your account. If it has been more than 24 hours and you're still not seeing any data, take a look at the list of possible reasons below:

系统检测到您的追踪器后,您将开始在实时报告中查看数据.部分数据也可能出现在标准报告中,但不可靠,因为数据需要 24 小时才能完成处理.

Once the system has detected your tracker you will start seeing data in the real-time reports. Some of the data may also appear in the standard reports but it is not reliable as it takes 24 hours for data to finish processing.

您的所有代码看起来都不错,您只需要等待.即使它是应用程序跟踪,上述内容也是相同的.我怀疑 Google 在那里设置新帐户需要时间.

All and all your code looks fine you just need to wait. The above is the same even though it is a application tracking. I suspect it takes time for Google to set up the new account on there side.

这篇关于iOS 上的 Google Analytics:未跟踪事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆