Search code examples
javaandroidgoogle-analyticsgoogle-analytics-sdkgoogle-analytics-firebase

Does Google Analytics Store the data offline when the user is not online?


I am using Google Analytics in my Android App to track some metrics regarding the usage etc.

I was just wondering whether Google analytics will cache the data of a user who uses my app offline and then record it later when his internet gets active?

Basically I wanted to track the number of users who use the app without internet and the number of users who use my app with internet.

Any help would be grateful.


Solution

  • Yes, GA can queue events while offline. I believe those events will be valid for up to 4 hours.

    importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.6.1/workbox-sw.js');
    
    workbox.googleAnalytics.initialize();