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