Analytics for PWAs: installs, launches, offline use and updates

Know how many people use your app as an app.

Quality, SEO and security Beginner 1 min read Reviewed Nov 27, 2026

Standard web analytics treat everything as a browser visit. Add a few events and dimensions to see how your PWA is really used.

What to track

SignalHow
Display modematchMedia('(display-mode: standalone)') as a user property or page dimension
Launch from iconstart_url with ?source=pwa; shortcuts with ?source=shortcut
Install prompt outcomebeforeinstallprompt > userChoice.outcome
Installsappinstalled (Chromium); first standalone launch (iOS)
Offline page viewsCount in the page, queue, send when online
Update acceptedWhen the user clicks your "reload" prompt
Push opt-inPermission result and subscription success

GA4 example

const mode = matchMedia('(display-mode: standalone)').matches || navigator.standalone ? 'standalone' : 'browser';
gtag('set', 'user_properties', { display_mode: mode });

addEventListener('appinstalled', () => gtag('event', 'app_installed'));
deferredPrompt?.userChoice.then(({ outcome }) => gtag('event', 'install_prompt', { outcome }));

Register display_mode as a custom dimension in GA4 to compare engagement and conversion between installed and browser users.

Offline events

Analytics requests fail offline. Either queue events in IndexedDB and send them later, or use Workbox's Google Analytics module, which replays failed GA requests when the connection returns.

Install and display-mode events go through your analytics like everything else, so the same consent rules apply. PWA.live loads Google Analytics only in production and only after you accept cookies; its install events use the same gate.