GoogleAnalytics tracks time between events

I am using GA on an Android app, but this question may be relevant across all platforms.

I track the event in the usual way:

t.send(new HitBuilders.EventBuilder()
.setCategory(getString(categoryId))
.setAction(getString(actionId))
.setLabel(getString(labelId))
.build());

      

Is there a way to see a report of how much time elapsed between such 2 events?

+3


source to share


1 answer


I ended up tracking the time in code and then reporting it like this:

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

      



This will give you a report under the Application Speed ​​section of the Behavior section of the Reports tab.

However, there was another issue regarding custom reporting of time events, which is described here: GoogleAnalytics HitBuilders.TimingBuilder

+2


source







All Articles