【发布时间】:2013-02-19 07:30:50
【问题描述】:
我正在尝试使用 Google 分析来跟踪我的应用速度,但我在我的 Google 分析帐户中看不到任何低于应用速度的内容。我已经跟踪了其他参数,例如事件、崩溃和异常。对于这些参数,我能够看到在我的谷歌分析帐户中生成的报告。以下是我用来发送事件计时的代码。
self.endDate=[NSDate date];
double timeDiff=[_startDate
timeIntervalSinceDate:_endDate];
NSLog(@"timeDiff----%f",timeDiff);
if([[[GAI sharedInstance]defaultTracker] sendTimingWithCategory:category
withValue:timeDiff
withName:@"LoadTime"
withLabel:category]) {
NSLog(@"Succesfully sent load time to GA");
}
以下是控制台中打印的消息。
GoogleAnalytics 2.0b4 -[GAIDispatcher dispatchComplete:withStartTime:withRetryNumber:withResponse:withData:withError:] (GAIDispatcher.m:415) 调试:成功发送命中 /GAIHit/p479 (0 次重试)。
如果您有任何示例代码,请提供给我。 请帮助我。提前致谢。
【问题讨论】:
-
很奇怪,对我来说很好用。你有哪个 GA 移动测试版?你如何启动谷歌分析?
-
没关系,你有最新的测试版(在日志中没有看到)。看来您正在发送良好的参数。尝试发送“NSTimeInterval”,但它与双精度相同,所以它不应该影响任何东西。什么打印 NSLog?
-
我使用的是iOS SDK 2.0 beta 4,我正在启动GA,如下所示,[GAI sharedInstance].trackUncaughtExceptions=YES; [GAI sharedInstance].dispatchInterval = 20; [GAI sharedInstance].debug = YES; self.tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-38230774-2"];
-
我收到消息已成功在控制台中将加载时间发送到 GA。
标签: ios google-analytics