Google Analytics 3.03 iOS SDK中的应用速度 [英] App Speed in Google Analytics 3.03 iOS SDK
问题描述
我已经看到过一些关于< 3.03以前版本的帖子似乎无效,并且我现在已经尝试了各种方法,但是似乎仍然行不通-行为/中没有任何内容/我的Google Analytics(分析)的应用速度"部分
I've seen a few posts around that previous versions <3.03 doesn't seem to work and I've tried all kinds of things now but this still doesn't appear to be working - nothing appears in the Behaviour/App Speed section of my GA
我正在使用iOS 3.03 GA SDK.这是我的代码:
I'm using the iOS 3.03 GA SDK. Here is my code:
- (void)onLoad:(NSTimeInterval *)loadTime {
NSNumber *n = [NSNumber numberWithDouble:*loadTime*1000];
NSLog(@"Time sent = %f ms", [n floatValue]);
id tracker = [[GAI sharedInstance] defaultTracker];
[tracker send:[[GAIDictionaryBuilder createTimingWithCategory:@"resources" interval:n name:@"candidatesLoadTime" label:@"loadTime"] build]];
}
在此先感谢您的帮助/建议
Thanks in advance for any help/advice
推荐答案
一段时间以来,我遇到了与您相同的问题,但最终找到了对我有用的解决方案!
I have had the same issue as you for a while, but finally found the solution that worked for me!
据我所知,它没有记录在案,但是 createTimingWithCategory:interval:name:label:
方法将interval参数作为 NSNumber >必须包含整数
值
It's not documented, as far as I can tell, but the createTimingWithCategory:interval:name:label:
method takes the interval parameter as a NSNumber
that is required to be contain an integer
value
尝试用以下方法替换方法的第一行:
Try replacing the first row of your method with this:
NSNumber *n = [NSNumber numberWithInt:(int)(loadTime*1000)];
贷方来自
Credits go to nh32rg from this answer
这篇关于Google Analytics 3.03 iOS SDK中的应用速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!