Google Analytics for Android caches hits while the device is offline. Unfortunately his older than 4 hours might get lost. (See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#qt )
The app in question will often be used in offline mode. I would prefer to not loose any hits. Inaccurate timestamps seem to be the smaller trade off.
I see the different ways to cope with analytics' shortcomings:
- Cache on the device in a wrapper for analytics. Call analytics multiple times when back online.
- Build a custom taking library, cache locally, send to custom tracking server. Save time delta's on that server and call analytics from there.
- Track with analytics and a custom library + custom server. Implement basic metrics on the custom server to get an idea what analytics fails to track.
Which would be the easiest and most accurate way? Is there any other methods to get complete and reliable offline tracking?