简体   繁体   中英

Google Analytics IOS SDK session timeout

Average time spent per visit as reported by Google Analytics does not match my server logs. What is the default idle session timeout for the IOS SDK?

The SDK version of Google Analytics doesn't work quite the same way as the web version. It looks like you need something along the lines of:

-(void) applicationDidEnterBackground:(UIApplication*)application
{
[[GANTracker sharedTracker] stopTracker];
}

You need to end a given session because an app running in the background will continue to hold that session. Monitor the application state and call the appropriate methods accordingly. More here:

Why are my iOS app's session lengths 30 min + in Google Analytics?

So, to answer your question you need to know how you're calculating time in app with your logs and how to emulate that with Google Analytics, taking the background state into consideration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM