Web push notification fundamentals
Learn how browser permission, service workers, subscriptions, push services, encryption, and visible notifications work together.
Web push is a standards-based delivery path from an application server to a browser-controlled push service, then to a service worker associated with one site origin.
Permission, subscription, encrypted delivery, notification display, and click handling are separate stages. A reliable implementation verifies each stage instead of treating “push” as one opaque feature.
Use the five-part system model
The browser records whether a person has granted, denied, or not yet answered the notification request for an origin.
A service worker gives the origin a background event handler and determines which URL scope it controls.
The browser creates an endpoint plus encryption key material and ties that record to the service-worker registration.
The application server encrypts a small payload and submits it to the push service identified by the endpoint.
The browser wakes the worker, which validates the payload, shows a notification, and handles the visitor’s click.
Write the system record before choosing a provider
- Origin
- The exact public HTTPS origin that owns permission, the service-worker registration, and the browser subscription.
- Message event
- The real condition that makes a notification useful now, such as an order-state change or a requested saved-search match.
- Subscription owner
- The account, anonymous browser, or signed-in profile allowed to create, update, pause, and delete the browser subscription.
- Delivery owner
- The application service that selects eligible subscriptions, encrypts payloads, applies TTL, sends requests, and records responses.
- Worker behavior
- The payload fields the worker accepts, the fallback used when data is missing, and the exact click-navigation rule.
- Exit path
- The visible preference or unsubscribe action plus the server behavior that prevents future selection.
If the team cannot name one owner for each field, the implementation is not ready for automation. The record also exposes whether a proposed feature belongs in browser code, the service worker, the application server, or product policy.
Choose web push for an asynchronous, permission-based need
Web push is useful when a person benefits from a timely message after leaving the site: an order status change, a saved-search match, a publication alert, a security event, or a reminder they requested. It is not a substitute for every email, in-app message, or live connection. A foreground interface may be better for continuous updates; email may be better for long-form records; an in-app inbox may be better when the information should remain available.
The practical test is simple: write the exact message, state why it matters now, and name the destination that resolves it. If the message cannot pass that test, adding browser permission and background delivery will not make it useful.
Separate what your application controls from what the browser controls
| Your application controls | The browser or operating system controls |
|---|---|
| The subscription explanation, audience rules, message content, send time, TTL, destination, and server-side retention. | The native permission interface, the push service, final presentation details, device settings, Focus modes, and whether a message appears. |
| How permanent failures retire endpoints and how clicks connect to downstream outcomes. | Whether the browser limits abusive prompts, removes storage, expires a subscription, or suppresses notifications under user settings. |
Start with a capability check, not a browser-name list
Browser support changes, and platform rules can differ even when the same APIs exist. Detect secure-context, service-worker, Push API, and Notifications API capabilities in the current environment. Then test platform-specific prerequisites. On Apple mobile devices, web push is associated with a Home Screen web app and permission must follow direct user interaction. On every platform, the person can later change notification settings outside your site.
Define success across the complete journey
A push-service acceptance is not proof that a person saw a notification. Track the stages you can observe without claiming more: eligibility, explanation shown, native prompt requested, permission granted, subscription stored, send attempted, service response, click, destination load, and meaningful downstream action. Record opt-outs and permanent endpoint failures beside positive events. This makes the channel diagnosable and keeps growth claims honest.
| Checkpoint | Evidence to retain | Question it answers |
|---|---|---|
| Subscription created | Site identifier, worker scope, key version, browser record identifier, and timestamp without exposing the endpoint in ordinary logs. | Was a usable subscription stored for the intended origin and sender identity? |
| Send attempted | Campaign identifier, eligibility reason, TTL, payload version, attempt time, and bounded provider response. | Did the application make the intended request, and how did the push service classify it? |
| Notification clicked | Campaign token, notification action, destination, and event time recorded by the worker or destination. | Did an interaction reach the destination promised by the message? |
| Useful action completed | The product event that fulfills the message, its attribution rule, and any exclusion or deduplication rule. | Did the notification support a meaningful outcome rather than merely generate a click? |
Use one test subscription to walk this ledger from beginning to end before increasing audience size. When a checkpoint is missing, stop there; later events cannot repair absent evidence from an earlier boundary.
Primary standards to keep nearby
The W3C Push API defines subscriptions and delivery to service workers. The Notifications API Standard defines notification presentation. RFC 8030 defines the HTTP Web Push protocol, while RFC 8291 covers message encryption.
Build the system in dependency order
Begin with the end-to-end model, then branch into compatibility, channel choice, and Apple-specific behavior.
-
Web push notifications guide: setup and delivery
Understand permission, subscriptions, VAPID, service workers, delivery, and measurement before sending your first campaign.
-
Web push browser support and requirements
Check HTTPS, service-worker, permission, installation, and platform requirements before promising web push to every visitor.
-
Web push vs email: choose the right channel
Compare Web Push and email by consent, urgency, message depth, destination, identity, measurement, and failure behavior.
-
Web Push vs APNs vs FCM: protocol comparison
Compare protocols for websites, iOS apps, and Android apps, including what a self-hosted push platform can and cannot control.
-
Web push notifications on iPhone and iPad
Understand the Home Screen web-app flow, direct-interaction permission rule, Focus behavior, and testing steps for Apple devices.