flâneur — a map of the web's best reading

Google Analytics for PWAs: Tracking offline behaviour and more - Builtvisible

builtvisible.com · 1,899 words · saved by 1 readers

PWAs bring a host of exciting new capabilities to the web, including push notifications, background sync, and offline usage. How can we capture data about these events in Google Analytics?

The old challenge: Single Page App JavaScript frameworks We'll get this out the way first. Pageview tracking with an SPA JavaScript framework is a well-known and well-documented challenge, and for many typical PWAs it's the most immediately obvious adaptation which is required. In short, if your PWA uses a framework like React or Angular to handle navigation events, then standard pageview tracking will not function. In contrast to traditional websites which do a round-trip to the server every time a page is loaded, SPAs load content and manipulate the URL with the History API . In other words,

Explore this link on the map →

saved by

related reading