Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Google Analytics for Android handle offline app usage?

I'm currently implementing Google Analytics into my app. The documentation says nothing about how tracking is handled when the user has no internet connection. Does the data get tossed or is it stored somewhere for later upload?

like image 846
soren.qvist Avatar asked Jul 08 '11 00:07

soren.qvist


2 Answers

It's not explicitly stated in the SDK documentation, as far as I can tell, but it implies that it stores the hits and waits until the user is online again to send them.

From the Android SDK Documentation:

Known Issues

- Possible inaccurate timestamps: timestamps are recorded at the time the application dispatches to Google Analytics, so if a user experiences long periods of offline use, the timestamps may not be 100% accurate.

like image 54
Yahel Avatar answered Oct 18 '22 07:10

Yahel


Yes, but it seems there is a caveat to be aware of...

Analytics records a Queue_Time parameter which you can use to calculate the "real" time of the event (as opposed to the "upload" time"). However the documentation implies that not all offline events will actually be sent if the user is offline for a long time:

Queue_Time

Used to collect offline / latent hits. The value represents the time delta (in milliseconds) between when the hit being reported occurred and the time the hit was sent. The value must be greater than or equal to 0. Values greater than four hours may lead to hits not being processed.

https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#qt

like image 37
Lesley Avatar answered Oct 18 '22 07:10

Lesley