2

I'm using GAI 3.15.

I have the following code in application: didFinishLaunchingWithOptions: and it works great.

NSDictionary *appDefaults = @{kAllowTracking: @(YES)};
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
[GAI sharedInstance].dispatchInterval = -1;
GAI.sharedInstance.trackUncaughtExceptions = YES;
self.tracker = [[GAI sharedInstance] trackerWithTrackingId:kTrackingId];

I've added code for reporting scene swaps, and I can see them in my GA view. I've added dispatch calls after each scene swap, and as you can see I've disabled auto-dispatching.

When I use the Real-Time view, scene swaps are reported almost immediately. But when I abort my app, it takes a couple of minutes for the user to be removed.

My question is the following: To my knowledge, I've not added any code to end the session. How does GA detect that the user has disappeared? Is there some kind of background polling mechanism, even if I've set dispatchInterval to -1?

And a follow-up: How come it takes only a couple of seconds for the scene swaps to get updated, but minutes for removing the user of a terminated app?

Fredrik Johansson
  • 1,301
  • 1
  • 13
  • 26
  • Would love to know this too. We are trying to track a pageview for our ios widget. We are trying to kill the session when the widget leaves the view via kGAISessionControl https://developers.google.com/analytics/devguides/collection/ios/v3/sessions I thought this would remove a user from the realtime view, but it is not. – Roy Kolak Oct 10 '16 at 18:47

0 Answers0