App Speed in Google Analytics 3.03 iOS SDK

我们两清 提交于 2019-12-11 05:40:37

问题


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

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


回答1:


I have had the same issue as you for a while, but finally found the solution that worked for me!

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



来源:https://stackoverflow.com/questions/21322983/app-speed-in-google-analytics-3-03-ios-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!