PWA vs native app for your store: when the web is enough
Guide/ 14 min read
What a PWA can do today on Android and iPhone, when a native app is worth paying for, and how to measure installs and launches in GA4, with code tested in Chromium.
- Performance
- JavaScript
- Analytics
In this article (7)
If shoppers find you through Google, ads or social and buy now and then, a PWA is enough: it installs from the browser, still answers offline and, since iOS 16.4, gets push notifications once added to the Home Screen. A native app pays off when customers reorder often or you need native-only features such as Live Activities.
Below: what Google, Apple and MDN say about each platform, when an app is worth it, and the minimum code (manifest, service worker and GA4 measurement) we tested in Chromium 151, with the real output.
What a PWA is and what it can do today
The web.dev Learn PWA course defines a PWA as a web app that uses progressive enhancement to be more reliable, uses new capabilities to integrate with the operating system, and can be installed. For a store, that is three pieces on top of the site you already run:
- HTTPS. Service workers and almost every API here only work in secure contexts; during development,
localhostand127.0.0.1count as secure. - A manifest: name, icons, start URL and display mode (MDN: web app manifest).
- A service worker: a script between the page and the network that decides what to answer. It gives you the offline page and push.
For Chrome to offer installation, web.dev's criteria ask for HTTPS and a manifest with short_name or name, 192 px and 512 px icons, start_url, a valid display (standalone, for example) and prefer_related_applications missing or false; the user also has to have tapped the page and spent 30 seconds on it. A service worker is no longer on the list: Chrome dropped that requirement for installing from the menu as of version 108 on Android and 112 on desktop. In our test, Chromium 151 flagged no installability errors without one. You still want it: without it there is no offline mode and no push.
What differs between platforms is what happens next:
| Capability | Android (Chrome) | iPhone and iPad (Safari) |
|---|---|---|
| Install | From the menu, or from your own button using beforeinstallprompt | Manually: Share > Add to Home Screen. Since iOS 26, every site added opens as a web app unless the user turns it off |
| Push | Push API with a service worker and the user's permission | Since iOS 16.4, only for Home Screen web apps; since 18.4, Declarative Web Push too, with no service worker |
| Icon badge | Badging API in the installed app | Badging API since iOS 16.4, in Home Screen web apps |
| Offline | Service worker and Cache Storage | Service worker and Cache Storage |
| Install event | appinstalled | None |
| App store | Google Play, through a Trusted Web Activity | App Store, under Apple's review rules |
The iPhone rows come from the WebKit blog: push and the Badging API in iOS 16.4 (February 16, 2023), Declarative Web Push in iOS 18.4 for web apps added to the Home Screen and the iOS 26 change. In the 16.4 post, WebKit explains that the icon launches a web app when the manifest's display is standalone or fullscreen; since iOS 26 that is the default. The Android rows come from web.dev and the Trusted Web Activity docs. MDN marks beforeinstallprompt, appinstalled and the Badging API as limited availability.
Scroll the figure sideways to see all of it
When a PWA is enough for an online store
Your online store already is a web app: catalog, cart and checkout run in the browser. A PWA adds an icon, an answer when there is no network and, if the shopper agrees, notifications. Our rule of thumb: it is enough when most of this holds.
- Shoppers arrive from Google, ads or social and buy on the first or second visit. The URL is what matters there; asking people to download an app before they buy adds a step.
- People reorder every few months, not every week.
- Notifications are a bonus, not the core of the business.
- You need no operating-system-only features, and you have one team: the web team.
Two limits. A service worker does not speed up the first visit: per web.dev, every request on it goes straight to your server because the worker does not control the page yet. If the hero image is slow, see how to make your hero image load first. And a PWA does not fix an awkward mobile checkout; that takes autocomplete and the right keyboard for every field.
Check your platform too. The service worker is served from your own origin and its default scope is the file's folder (MDN: register()): to control the whole store, /sw.js sits at the domain root or the server sends Service-Worker-Allowed. If your platform will not let you publish that file, do not go headless just for this; read when headless is not the answer first.
The manifest
{
"id": "/",
"name": "Tienda Demo",
"short_name": "Demo",
"start_url": "/?source=pwa",
"scope": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#151412",
"icons": [
{ "src": "/icons/icon-192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/icons/icon-512.png", "sizes": "512x512", "type": "image/png" }
]
}
idis the app's identity. Per MDN, when it is missingstart_urlis used, and a differentidcounts as a different app. Setting it lets you changestart_urlwithout creating a new app.nameandshort_name: the full name and the one that fits under the icon.start_urlopens the store with?source=pwa, the marker we will measure.scopesays which URLs belong to the app; with"/", the whole store.display: "standalone"opens the app in its own window, with no address bar.background_coloris the background before the CSS loads;theme_coloris the color the system uses around the app.icons: the two sizes Chrome asks for, as PNG.
Link it in the <head> of every page with a <link rel="manifest"> tag pointing to /manifest.webmanifest, and serve it as application/manifest+json, the type MDN gives.
The service worker: shell from the cache, HTML from the network
const CACHE = "shell-v1";
const SHELL = ["/offline.html", "/app.css", "/icons/icon-192.png"];
self.addEventListener("install", (event) => {
event.waitUntil(caches.open(CACHE).then((cache) => cache.addAll(SHELL)));
});
self.addEventListener("activate", (event) => {
event.waitUntil(
caches.keys().then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))),
);
});
self.addEventListener("fetch", (event) => {
const { request } = event;
const url = new URL(request.url);
if (request.mode === "navigate") {
event.respondWith(fetch(request).catch(() => caches.match("/offline.html")));
} else if (request.method === "GET" && url.origin === location.origin && SHELL.includes(url.pathname)) {
event.respondWith(caches.match(request).then((hit) => hit || fetch(request)));
}
});
CACHEis the versioned cache name: bump it toshell-v2when these files change.SHELLis the app shell: offline page, CSS and one icon. No products, no cart.- On
install,waitUntilwaits forcache.addAll, which stores everything as one transaction: if one file fails, you are not left with half a cache. - On
activate, caches with any other name are deleted, so a new version does not leave the old one taking up space. - Navigations go to the network first; only when it fails is
offline.htmlserved. That is the Network First strategy from web.dev, minus storing each page's HTML: nobody sees a stale price or stock level as if it were current. - Shell files, fetched with
GETfrom your origin, come from the cache first (Cache First). - Everything else (the cart API, checkout, third-party scripts) is left alone: without
respondWith, it goes to the network as if there were no service worker.
Register the service worker
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/sw.js");
}
- The check avoids an error in browsers without support, where the store keeps working as before.
register("/sw.js")from the root covers the whole store. The first visit installs it, and the page is controlled from the next load.
When a native app is worth it
A native app pays off when customers already come back without you paying for an ad, and you need something the web cannot give you. These are the signals we look for:
- Frequent reorders from signed-in customers. Groceries, coffee subscriptions, pharmacy: the shopper buys every week or month while logged in, and a reorder button saves steps on every purchase.
- Operating-system-only features. With ActivityKit, an app shows Live Activities which, according to Apple, appear on the Lock Screen, in the Dynamic Island and on the Home Screen of iPhone and iPad, such as delivery status. A PWA cannot.
- The app store as a channel. If your audience searches the App Store or Google Play, being there helps, although web.dev notes a PWA can also be listed on Google Play, the Microsoft Store and the App Store.
- Push as your main channel on iPhone. On iOS, web push only reaches people who added the web app to the Home Screen, a manual step with no automatic prompt. If you depend on that, measure how many people take it before you decide.
Add up the fixed cost too. You need an account in each store: the Apple Developer Program is 99 USD per membership year and Google Play charges a US$25 one-time registration fee. That is two more apps to ship and maintain, and guideline 4.2 of Apple's App Review Guidelines asks for more than a repackaged website: wrapping your store in a web view does not make it native. For physical goods, guideline 3.1.3(e) requires payment methods other than in-app purchase, such as Apple Pay or card entry.
Scroll the figure sideways to see all of it
That table is our rule of thumb, not an Apple or Google rule. If almost everything lands in the PWA column, start there and ask again once you have usage data:
Scroll the figure sideways to see all of it
How to measure whether your PWA gets installed and used
Measure installs and launches from the icon. Per web.dev, appinstalled only fires in Chromium browsers, when the user accepts the install (on Android with a WebAPK, when the dialog is accepted, not when installation finishes). iPhone has no such event, so we also measure launches: start_url carries ?source=pwa, and the display-mode media query tells you whether the page runs in its own window. This is the rest of pwa.js, below the registration:
window.addEventListener("appinstalled", () => {
gtag("event", "pwa_install");
});
const standalone = window.matchMedia("(display-mode: standalone)").matches;
const fromIcon = new URLSearchParams(location.search).get("source") === "pwa";
if (standalone && fromIcon) {
gtag("event", "pwa_launch");
}
gtagalready exists if your GA4 tag is on the page;gtag("event", "<event_name>", {...})is the form in GA4's event docs. We send no parameters here.appinstalledsendspwa_installonce, when the install is accepted, and only in Chrome, Edge and other Chromium browsers.matchMedia("(display-mode: standalone)")is true when the page opened in its own window; web.dev says to match the mode in yourdisplay, and MDN lists the values.fromIconlooks forsource=pwa, which only the first page of each launch from the icon carries.- With both conditions,
pwa_launchcounts launches, not every page viewed inside the app.
Both names follow GA4's event naming rules: they start with a letter, use letters, numbers and underscores, and are not reserved. GA4 is case sensitive: PWA_Launch would be a different event.
To see whether it gets used, build a session segment in Explore of sessions that include pwa_launch; per GA4's help on segments, segments only exist in Explore and are retroactive. Compare it with everyone else: purchases, revenue and how often they return. If your cart tracking is not solid yet, start with the GA4 add_to_cart event. If hardly anyone opens the store from the icon, we read that as a sign a native app would not have many people to keep either.
What we tested
We served the files with node:http on 127.0.0.1 and opened them in Chromium 151 from Playwright 1.62 (Windows 11, Node 22.22.3). The page defines gtag with the two lines from Google's snippet without loading gtag.js, so nothing left the machine. We asked the browser for the manifest over the DevTools protocol. This is the output:
Chromium 151.0.7922.34
ok first load: registration active, page not controlled: {"active":"activated","scope":"http://127.0.0.1:55207/","controller":null}
ok after reload: controlled by: {"controller":"http://127.0.0.1:55207/sw.js","state":"activated"}
ok cache shell-v1: ["/app.css","/icons/icon-192.png","/offline.html"]
ok CDP Page.getAppManifest: browser fetched it, errors: []
ok manifest fetched and parsed: {"type":"application/manifest+json","name":"Tienda Demo","start_url":"/?source=pwa","display":"standalone","icons":["192x192","512x512"]}
ok CDP parsed manifest: {"id":"http://127.0.0.1:55207/","startUrl":"http://127.0.0.1:55207/?source=pwa","display":"kStandalone"}
ok CDP Page.getInstallabilityErrors: []
ok tab: display-mode: {"standalone":false,"browser":true,"events":[]}
ok simulated appinstalled -> dataLayer: [["event","pwa_install"]]
ok simulated standalone + ?source=pwa -> dataLayer: [["event","pwa_launch"]]
ok simulated standalone without ?source=pwa -> no event
ok offline navigation: {"title":"Sin conexión","h1":"Sin conexión"}
12 checks passed
- First load: the service worker reaches
activated, butcontrollerisnull. - After a reload,
/sw.jscontrols the page. - The
shell-v1cache holds exactly the three shell files. - Chromium fetched the manifest with no errors, and a
fetchconfirms the type and fields. idresolved to the origin plus/;kStandaloneis Chromium's internal name forstandalone.- No installability errors. We did not test the install prompt or a real install.
- In a tab,
standaloneis false: with?source=pwa, nothing was sent. - Simulated install: we dispatched
appinstalledby hand andpwa_installarrived. - Simulated launch: we replaced
matchMediato answerstandalone; with?source=pwa,pwa_launcharrived, and without it, nothing. - Offline, a product URL that was never visited returned
offline.html.
We did not test on an iPhone: before you trust the number, confirm in DebugView that pwa_launch arrives from the Home Screen web app.
Common mistakes
- Caching product pages or the cart. With Cache First on HTML, a shopper can see an old price, or a sold-out item shown as available. Cache only the shell.
- Intercepting checkout or the cart API. If you have no use for those requests, do not call
respondWithfor them. - Waiting for
beforeinstallprompton iPhone. Per web.dev, Chrome and Edge on iOS do not install PWAs. Show manual instructions, and only in browser mode, with the same media query. - Asking for notification permission on page load. WebKit requires the request to come from a direct user interaction, such as tapping "Notify me when it's back".
- Adding
?source=pwato an installed PWA with noid. Withoutid, the identity is thestart_url, and changing it creates another app. Setidto your currentstart_urlfirst, then add the parameter. - Measuring only
appinstalled. That leaves out every iPhone. - Expecting installs from Instagram. web.dev warns that many in-app browsers, Instagram's and Facebook's among them, cannot install PWAs: someone arriving from a Reel has to open the store in Safari or Chrome.
Frequently asked questions
Can a PWA be listed on Google Play or the App Store?
Yes, as an optional channel, per web.dev. On Android you package it as a Trusted Web Activity, which uses Digital Asset Links to verify the app and the site belong to the same developer. On the App Store, Apple's guideline 4.2 applies: the app has to go beyond a repackaged website.
Do PWA push notifications work on iPhone?
Yes, since iOS 16.4, but only for web apps added to the Home Screen, and permission is requested after a user interaction. They do not reach a Safari tab. Since iOS 18.4 there is also Declarative Web Push, which needs no service worker.
Do I need a service worker for a PWA to be installable?
For installing from Chrome's menu, no longer, as of version 108 on Android and 112 on desktop. The Chrome post that announced it noted that the automatic install prompt still required a fetch handler; ours has one, and you need it anyway for offline mode and push.
Does a PWA make the store faster or help SEO?
Not on the first visit, because the service worker does not control the page yet; on later visits the shell comes from the cache. It does not change your URLs or your HTML, so it is not an SEO change in itself. For speed, start with LCP.
Checklist
- The store is served over HTTPS.
- The manifest has
id,name,short_name, astart_urlwith?source=pwa,scope,displayand 192 px and 512 px icons. - Every page links the manifest, served as
application/manifest+json. /sw.jslives at the root and is registered on every page.- The cache holds only the shell and
offline.html; HTML, cart and checkout go to the network. - The cache name changes whenever the shell changes.
- GA4 receives
pwa_installandpwa_launch, confirmed in DebugView. - You have an Explore segment of sessions that include
pwa_launch. - You decide on a native app with that data, not before.
A PWA does not replace the basics: a store that loads fast (hero image LCP), a checkout that is easy on a phone (mobile checkout autocomplete) and measurement you can trust (the GA4 add_to_cart event). And if someone pitches rebuilding the store just to get an app, read when headless is not the answer first.
Saw this on Instagram? Comment PWA on the Reel and I'll send you the guide.
Written by

Published November 3, 2026