I need to start and to stop a session at a specific hour.
In official documentation I have found only that I can start a new session :
// Called after a user successfully signs in to your app.
private void onSignIn() {
... // The rest of your onSignIn() code.
myTracker.setStartSession(true); // Where myTracker is an instance of Tracker.
myTracker.sendEvent("app_flow", "sign_in", "", null); // First activity of new session.
}
But I have no methods in API to stop the session or to change the session time out.
I already tried to set ga_sessionTimeout to 1 day but it didn’t worked,
after ~8 minutes the session was closed even when the activity was still on the screen.I saw it on my Google Analytics dashboard’s real-time overview.
Other ideas will be appreciated.
My goal was to keep the session alive till some event happen,
therefore I decided to implement Heartbeat mechanism.
That will send event every X minutes to keep the session alive.
It solved my problem.
P.S. : I discovered another thread with same solution.