How long time is data cached with GA plugin in Unity apps

Viewed 33

We have an Android app built using Unity and the Google Analytics GAv4 plugin for Unity.

The use-case is that the users might use the app for days without internet, and when they do connect to internet again our expectations is that the data is cached on the device and will then be sent off.

Our initial tests seems to work, but cannot find any reference to how long the data persists on the device, and if there are any expiration of the data. The users have experienced that they miss some data generated when offline.

I have tried exploring the plugin, but cannot seem to find anything about how it caches the data. Anyone who have experience with this?

1 Answers

It looks like it is using com.google.android.gms.analytics.GoogleAnalytics which you can search the documentation on. It also might depend on the highest API level/android version on their device, where low version may not be able to send while offline or something. I think this page explains a little about how it keeps checking for a connection and tries to dispatch the events: https://developers.google.com/android/reference/com/google/android/gms/analytics/GoogleAnalytics#dispatchLocalHits()

I saw in the plugin source code here: https://github.com/googleanalytics/google-analytics-plugin-for-unity/blob/master/source/Plugins/GoogleAnalyticsV4/GoogleAnalyticsAndroidV4.cs

Related