简体   繁体   中英

How to measure how much time all users spend in the app with Google Analytics

We have successfully implemented GA but one thing is still a riddle.

What I'm looking for is how much time (sum) users spend using the app. I need simple report with time period on the X axis and sum of minutes on the Y axis. This can help to measure user engagement in minutes during the time.

Did anyone figure how to implement it on Android and iOS?

Get it the start time and store it somewhere when the app starts.

long startTime = Calendar.getInstance().getTimeInMillis();

Also get the end time after the user logged in to the app.

long endTime = Calendar.getInstance().getTimeInMillis();

Get the time spent by the user.

long timeSpent = endTime - startTime;

Then use the 'GoogleAnalyticsTracker.getInstance().setCustomVar()' method to set this data inside your track event.

also check this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM