firebase / quickstart-cpp

Firebase Quickstart Samples for C++
https://firebase.google.com/games
Apache License 2.0
206 stars 122 forks source link

Setting minimum session duration to 1s and session timeout to 5s will result is lots of session #2

Closed djabi closed 5 years ago

djabi commented 7 years ago

The default session configuration is 10 seconds minimum session and 30 minutes session time out. There is a reason why we choose this values. Setting session timeout to 5 seconds practically means every time the app is backgrounded a new session will be recorded. This defeats the purpose of session. The example app should set the default values instead of 1/5seconds:

// App needs to be open at least 10s before session will be started analytics::SetMinimumSessionDuration(10000); // App session times out after 30 minutes analytics::SetSessionTimeoutDuration(1800000);

patm1987 commented 5 years ago

This is done now in common_main.cc as:

  // App needs to be open at least 10s before logging a valid session.
  analytics::SetMinimumSessionDuration(1000 * 10);
  // App session times out after 30 minutes.
  // If the app is placed in the background and returns to the foreground after
  // the timeout is expired analytics will log a new session.
  analytics::SetSessionTimeoutDuration(1000 * 60 * 30);