Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see 'User timing' on Google Analytics dashboard?

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.

like image 746
Salmo Avatar asked Mar 22 '23 01:03

Salmo


1 Answers

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

like image 97
alleus Avatar answered Apr 02 '23 19:04

alleus