I'm using GA in my iOS app and everything is working fine for all trackers but now I added tracker for User Timing and I'm not able to see the information I'm sending.
This is the code I'm using:
NSTimeInterval timeInterval = [timeOfPause timeIntervalSinceDate:timeOfStart];
NSNumber *timeUsed = [NSNumber numberWithDouble:timeInterval];
[tracker send:[[GAIDictionaryBuilder createTimingWithCategory:@"ui_action"
interval:timeUsed
name:@"time used"
label:nil] build]];
I can see logs and values and they are ok but I can't find these informations on GA site.
I think your problem is that you initiate your NSNumber
instance (timeUsed
) with a decimal value. The GA V3 SDK seems to require it to be an integer value. Also, the createTimingWithCategory:interval:name:label:
method expects the interval in milliseconds.
Your code should work if you change the second row in your code to:
NSNumber *timeUsed = [NSNumber numberWithInt:(int)(timeInterval*1000)];
See this answer: https://stackoverflow.com/a/21408160/1652146
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With