firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
825 stars 428 forks source link

[Question] Is it possible to delay session_start event until I set a custom UserId? #1129

Open revolt3r opened 3 years ago

revolt3r commented 3 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the question here:

I would like to still initialize Crashlytics as soon as possible, but delay the very first session_start event until later when I get and can set a custom UserId

paulinon commented 3 years ago

Hi @revolt3r,

Unfortunately, there is no API that allows you to delay the session_start event as this is ​automatically collected by the SDK when a user engages with the app.

Is this a feature that you would like to be implemented? If so, kindly provide a use case so that we can have a better understanding of what you want to achieve in your implementation.

revolt3r commented 3 years ago

Hi @paulinon,

so the use-case I have is that I want to calculate my DAU based on the firebase session start event. I use the Firebase BigQuery export and set up a custom daily scheduled query to create a table with all session starts. Currently, the user_id field in the first session for each user is NULL, which means that users that only have one session would not be considered (as I'm counting on distinct user ID and group by date). I know that I could also calculate DAU off other event types, but each user always has the first session so this is the industry standard. Also, I would never know when a specific user had their first session.

Attached you can find a screenshot of my desired table. As you can see whenever session_number is 1 the user id is NULL. image

fgatti675 commented 2 years ago

I am facing a similar issue, being able to set the user_id to the events of a session that has already started would help a lot