GoogleAnalytics HitBuilders.TimingBuilder

I am using GA for an Android app.

I'm trying to use user timings to report how much time has passed for some activity in my code, so I basically do the following:

At some point in the code I get System.currentTimeMillis()

, at another point I do it again and subtract the last from the first to see how much time has passed. Then I report it to GA like this:

long time1 = System.currentTimeMillis();
...
long time2 = System.currentTimeMillis();
long timingValue = time2 - time1;
tracker.send(new HitBuilders.TimingBuilder()
            .setCategory(timingCategory)
            .setValue(timingValue)
            .setVariable(timingVariable)
            .setLabel(timingLabel)
            .setCustomDimension(1,1)
            .setCustomMetric(1, timingValue).build());

      

When I look at the Application Speed ​​section, everything looks great. It seems to be reporting the logical average time in seconds as I expect.

The problem is that I want to use multiple dimensions (secondary dimension is not enough), so I created all of these timings as metrics so that I can see them in a custom report. When I look at the report, the time I see is there 09:43:39

and I'm not sure what format is here. These are seconds: tenth of a second: hundredth of a second? And how can I see the average time of these indicators? I'm not sure if what I am seeing is just total time or something else?

0


source to share


1 answer


A Value

type time (for both events and custom metrics) must be passed as an integer (no commas or decimal places) representing seconds. So, for example, 10 seconds should be 10, and 5 minutes should be 300, etc. Please note that the reports will be formatted ashh:mm:ss

.



+1


source







All Articles