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

查看:411
本文介绍了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天全站免登陆