How does Google Analytics for Android handle offli

2020-02-23 06:48发布

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?

2条回答
Viruses.
2楼-- · 2020-02-23 06:52

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

查看更多
疯言疯语
3楼-- · 2020-02-23 07:09

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.

查看更多
登录 后发表回答