quickstart-unity icon indicating copy to clipboard operation
quickstart-unity copied to clipboard

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

Open revolt3r opened this issue 4 years ago • 3 comments

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.3.17f1
  • Firebase Unity SDK version: 17.0.0
  • Source you installed the SDK: .unitypackage (.unitypackage or Unity Package Manager)
  • Problematic Firebase Component: Analytics (Auth, Database, etc.)
  • Other Firebase Components in use: Crashlytics (Auth, Database, etc.)
  • Additional SDKs you are using: Not relevant (Facebook, AdMob, etc.)
  • Platform you are using the Unity editor on: Windows (Mac, Windows, or Linux)
  • Platform you are targeting: iOS, Android (iOS, Android, and/or desktop)
  • Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)

[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

revolt3r avatar Sep 02 '21 11:09 revolt3r

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.

paulinon avatar Sep 03 '21 10:09 paulinon

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

revolt3r avatar Sep 07 '21 13:09 revolt3r

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

fgatti675 avatar Jul 19 '22 17:07 fgatti675