1. Home
  2. How to
  3. How to use Offline Google Analytics in PWA

How to use Offline Google Analytics in PWA

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:

You will find this option in the WordPress Dashboard -> Navigate to PWA -> Settings -> Advance -> Check this “Offline Google Analytics” option and then click on the “Save Setting” button.

  • Offline Google 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.

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.

Updated on November 11, 2019

    Are you still looking for a solution?

    Then fill out the below form and we will reach out to you within a few hours.

    Was this article helpful?

    Related Articles

    Need Support?
    Can’t find the answer you’re looking for? Don’t worry we’re here to help!
    Contact Support