Firebase Analytics如何精确地处理会话持续时间/超时? [英] How exactly do Firebase Analytics handle session duration / timeouts?

查看:204
本文介绍了Firebase Analytics如何精确地处理会话持续时间/超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firebase Analytics在Android / iOS应用中首次实现一些基本使用情况统计信息,但是对于我来说,关于如何精确计算会话持续时间以及如何超时会话以及24小时的周期查看结果不利于通过反复试验来理解。

I'm implementing some basic usage statistics for the first time in an Android/iOS app using Firebase Analytics, but the docs seem a little ambiguous to me on how exactly session durations are calculated and how sessions are timed out, and the 24-hour cycle for seeing results does not help in understanding by trial-and-error.

我现在只对一个非常简单的统计感兴趣-时间用户花在应用程序上。当应用程序最小化 /在后台时究竟发生了什么-是算作活动使用还是与关闭应用程序相同-目前尚不那么重要,但是如果您需要在这方面添加一些内容,

I'm only interested in a very simple statistic for now - the time users spend in the app. What exactly happens when the app is "minimised"/"in the background" - does that count as active usage or the same as the app being closed - is not so important right now, but if you have something to add in this regard in the context of the question, please do.

据我了解,Firebase Analytics应该可以立即使用这样简单的统计信息,所以我m当前仅使用将Firebase Analytics链接到项目中,添加配置文件并调用FirebaseAnalytics.getInstance(this),而不使用任何自定义事件或任何更出色的方法。在Android和[FIRApp配置]上;在iOS上。

From what I understand such an easy statistic should probably be available out-of-the-box with Firebase Analytics, so I'm currently not using any custom events or anything fancier than simply linking Firebase Analytics into the projects, adding the configuration files, and calling FirebaseAnalytics.getInstance(this); on Android and [FIRApp configure]; on iOS.

我看到控制台中按预期显示了first_open,session_start和app_remove事件,仪表板上的一些汇总会话数据,等等,我也知道有一个可配置的会话超时。

I'm seeing first_open, session_start and app_remove events show up in the console as expected, some aggregate session data in the dashboard, etc, and I also know there is a configurable session timeout available.

但是我不清楚的是,用户会话何时确切到期-Firebase只要应用程序自动保持打开状态是开放的,还是我需要确保发布一些虚假的保持活动事件,以防止在用户仍在实际使用该应用程序时终止用户会话。

But what is unclear to me is, when exactly does a user session expire - does Firebase automatically keep it open as long as the app is open, or do I need to make sure to post some artificial "keep-alive" events to prevent user sessions from expiring while a user is still actually using the app.

假设以下内容:


  1. 我没有使用Firebase发送任何明确的自定义事件,因为这不是应用程序明确要求的

  2. 在单次运行应用程序时,我只会触摸一次Firebase-在启动时对其进行初始化。

  3. 用户在应用程序中停留了很长时间(假设2小时-比默认的30分钟会话超时长得多),而无需与之交互-例如读取内容,观看视频等,这些都不会生成Firebase可以看到的任何事件,但是该应用程序可以防止屏幕锁定,该应用程序仍处于前景状态。

对于用户而言,这将算作一个2小时的会话吗?它会仅算作30分钟的会话,因为该会话在30分钟后过期,并且没有任何事件使它保持活动状态吗?

Will that count as a single 2 hour session for the user? Will it only count as a 30 minute session since the session expires after 30 minutes and no events are generated to keep it alive? Will something else happen?

奖金问题:如果用户退出应用的时间短于或长于会话超时,会发生什么?

Bonus question: what happens if the user exits the app for a time shorter/longer than the session timeout?

奖金问题:如果不是从应用程序退出而是直接进入后台,会发生什么变化吗?

Bonus bonus question: does something change if instead of exiting from the app, it is simply put into background?

谢谢!

推荐答案

快速解答:您描述的方案将导致一个2小时的会话。

Quick answer: The scenario you describe will result in a single 2-hour session.

会话基于应用程序活动是当前活动的时间。无需发送事件;从活动恢复到暂停的时间算作参与时间。在持续参与的一个小时结束时,将记录一个参与事件,但这不会结束会话。如果连续一段时间(默认为30分钟)是该应用程序的活动都不是当前活动,则会话将终止。
如果用户退出应用的时间短于会话超时,然后重新启动,会话将继续。如果用户退出应用程序的时间超过会话超时时间,则会话结束。退出应用程序并将其置于后台之间没有任何变化。如果不是用户正在看的东西,那么这并不算是应用程序正在运行的参与程度。

Sessions are based on the time that an app's activity is the current activity. There is no need to send events; the period from the time an activity resumes to the time it is suspended is counted as engagement time. At the end of an hour of continuous engagement an engagement event will be logged but this does not end the session. A session expires when there is a continuous period (30 minutes by default) that none of the app's activities is the current activity. If the user exits the app for a shorter period than the session timeout and then restarts it, the session continues. If the user exits the app for longer than the session timeout, then the session ends. No change between exiting the app and putting it in the background. If it's not the thing the user is looking at, it doesn't count as engagement for the app to be running.

这篇关于Firebase Analytics如何精确地处理会话持续时间/超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆