2

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?

HrLarsen
  • 105
  • 10

1 Answers1

0

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

Michael Urvan
  • 492
  • 3
  • 8
  • The application is running on relatively new Android versions, so this should not be an issue. From what I can read (or the lack of) there does not seem to be a limit on how long the data will queued in the application store (local storage) before being dispatched if there is connection? – HrLarsen Nov 04 '21 at 10:16