So you’ve got a progressive web app, complete with a service worker that allows it to work offline. You’ve also got existing Google Analytics set up for your web app, and you don’t want to miss out on any analytical insights coming from usage that occurs while offline.
But if you try to send data to Google Analytics while offline, those requests will fail and the data will be lost. It’s adding code to your service worker to store Google Analytics requests and retry them later when there’s hopefully a network available.
For the solution of this situation we created an option as follows:
Step 1: First thing you need to do is to install and activate the SuperPWA plugin.
Step 2: After installing the plugin in the dashboard, You will find this option in WordPress Dashboard -> Navigate to SuperPWA option -> Settings -> Advanced -> Check this “Offline analytics” option like below the screenshot.
- Offline Analytics: Offline analytics is a module that will use background sync to ensure that requests to Google Analytics are made regardless of the current network condition.
Step 3: Click on the “Save Settings” button
That’s it for this tutorial!
We hope we’ve clear your doubts in case If you have any feedback or questions, Just contact us here and we are always available for you