AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
5.4K members online now
5.4K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

What is the GA default session timeout for Android application

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Android GA documentation is bit confusing.

 

The Java api says default timeout is 30 seconds.

https://developers.google.com/android/reference/com/google/android/gms/analytics/Tracker.html#setSes...

 

However same document says ga_sessionTimeout is 1800 which is 30 minutes.

 

ga_sessionTimeout(int) - time (in seconds) an app can stay in the background before a new session is started. Setting this to a negative number will result in a new session never being started. Default is 1800 seconds (30 minutes).

 

 

My actual experiment shows that this timeout is 300 seconds. Is this because some XML resource is setting this timeout.

 

https://developers.google.com/analytics/devguides/collection/android/v4/sessions

 

Does anyone know what is the timeout value for session is for Android application? Unfortunately Tracker object doesn't have get method, or any other methods to figure out the value could me.

 

(Cross posting on stack overflow too)

1 Expert replyverified_user

Re: What is the GA default session timeout for Android application

Top Contributor
# 2
Top Contributor
Hi Subodh,

I believe you're confusing the 30 second timeout as the standard session when actually there is a 30 seconds period that the app can stay in the BACKGROUND before if you re-open it, it will count as a new session. That means if someone uses the Google Analytics mobile app, but leaves the app but does not close it, if the person returns to the app within 30 seconds it will still count as the same session BUT if they return after 30 seconds have passed UA will record this as a new session.

The standard session for UA for both mobile and web is 30 minutes. Also bonus info, iOS pushes new hits every 2 minutes and Android only pushes new hits to the UA server every 30 minutes.

Hope this has helped!
- Josh
Joshua, Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

Re: What is the GA default session timeout for Android application

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hello Josh,

First thanks for your reply. That kind of explains why we see huge number of sessions for our Android application,
where as iOS app even when it has X times number of installs , shows much smaller session count.

Also I thought activity autoTracking wouldn't start a new session if activity merely resumed (onResume) and would record new session if only onCreate of Application class

How is a session counted on iOS I guess applications have to do it by itself and thus GA gets true number of sessions in case iOS?

What is the GA default session timeout for Android application

[ Edited ]
Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

I'm confusing too. The ga_sessionTimeout and Java API setSessionTimeout has the same definition. Does that mean ga and UA session are different things? If they are the same thing, why have two default value 30 seconds and 30 minutes?