Does google analytics SDK caches all data for sending them later if no Wifi is available? I guess everything is OK when iPhone/iPad is online (has internet available) then it sends all events data. But what about its functionality when the device has no internet connection? Do I have manually to check for internet connection (for example with apple reachability class) and maintain the data cache for later use myself?
Short answer: yes.
More details:
In case you use dispatch period greater than zero (let's say 15):
In case you use dispatch period is equal to -1, which means you dispatch your events manually by calling [[GANTracker sharedTracker] dispatch]
:
dispatch
but connection is not available, event will get cached, so next dispatch
call will try to send cached events in a batch,The above also applies to a mix of above two cases: you use dispatch period > 0, but you decide to dispatch some events manually.
Note: I have no idea how much events/data can GA tracker cache before its' buffers get overwritten or go haywire.
Some other tips for using GA:
dryRun
to YES and test
your scenario. Also you can use some other account ID for testingGANTrackerDelegate
methods to see if hits were dispatched.This is a related question, basically you need to use batching. I think Flurry analytics makes this aspect more transparent (you just log events and it takes care of everything).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With