问题
Firebase Analytics has a number of stats around "Sessions" (like "Sessions per user" and "Average session length"), but how exactly does Firebase Analytics define a session?
回答1:
And I'll answer my question by saying that Firebase Analytics defines a session as a user engaging with your app for a minimum amount of time (10 seconds by default) followed by your user not engaging with your app for a certain amount of time (30 minutes by default). But you can change those times if you'd like something different.
So if a user starts using your app, switches to messaging to send a message, goes back to your app, switches to messaging again to send a quick selfie, then goes back to your app, that's all considered just one session.
Similarly if a user accidentally taps on your app icon and then quickly switches away to open up the app they actually meant to open, that won't get recorded as a session.
回答2:
Adding to Todd Kerpelman's response above, you can customize the definition of a session via FirebaseAnalytics.setMinimumSessionDuration(long millis) and FirebaseAnalytics.setSessionTimeoutDuration(long millis).
The docs are at: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics
(Sorry, don't have the reputation to make this a comment)
来源:https://stackoverflow.com/questions/41030377/how-does-firebase-analytics-define-a-session