简体   繁体   English

如何使用Google Analytics(分析)评估所有使用者在应用程式上花费的时间

[英]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. 我们已经成功实施了通用Analytics(分析),但仍然有一个谜。

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. 我需要在X轴上有时间段的简单报告,在Y轴上有分钟的总和。 This can help to measure user engagement in minutes during the time. 这有助于在几分钟内衡量用户的参与度。

Did anyone figure how to implement it on Android and iOS? 有人知道如何在Android和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. 然后,使用'GoogleAnalyticsTracker.getInstance().setCustomVar()'方法在跟踪事件中设置此数据。

also check this 也检查一下

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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