Web Push Notifications for Websites: Opt-In, Timing and Results
Most visitors leave a website and never come back. They meant to return to that product, that article or that quote request, but life got in the way. Email needs an address. Mobile push needs an app. Web push notifications sit in between: with one click of permission, a website can send timely messages straight to a visitor's browser or device, without an app install and without collecting an email address.
Used well, web push is a quiet, useful re-engagement channel. Used badly, it becomes the reason people click "Block" on your site forever. This guide explains how web push works, when to ask for permission, what to send and how to build it properly into your website.
How Web Push Notifications Work
Web push relies on three building blocks that modern browsers support:
- Service worker: A small script your site registers in the browser. It runs in the background and can receive messages even when your site is closed.
- Push subscription: When a user grants permission, the browser creates a unique subscription endpoint for your site. Your server stores it.
- Push service: Your server sends an encrypted message to that endpoint using VAPID keys. The browser's push service delivers it, and the service worker displays the notification.
Support is strong across Chrome, Edge and Firefox on desktop and Android. On iOS, Safari supports web push for web apps added to the home screen, which makes a well-built progressive web app even more valuable.
Web Push vs Mobile Push vs Email
- Email is best for long, detailed content and works with almost everyone, but needs an address and competes in crowded inboxes.
- Mobile app push is powerful for engaged app users. We cover it in our push notification strategy guide for mobile apps.
- Web push is lightweight, needs no app and no personal details, and suits short, time-sensitive messages.
The channels work best together. A visitor might subscribe to web push today and give you their email later when they request a quote.
The Opt-In Problem and How to Solve It
The biggest mistake websites make is firing the browser's permission prompt the moment someone lands on the page. The visitor has no idea who you are or what you will send, so they block it. Once blocked, you usually cannot ask again.
A better pattern uses a two-step opt-in:
- Show your own soft prompt, designed in your brand style, at a meaningful moment. For example, "Want an alert when your order ships?" or "Get notified when this item is back in stock."
- Only if the visitor taps "Yes" do you trigger the real browser permission prompt.
Good moments to ask include after an order, when tracking a delivery, when a product is out of stock, when saving a search, when following a topic or after reading several articles in a session.
What to Send (and What Not to Send)
Messages that earn their place
- Order and delivery updates
- Back-in-stock and price-drop alerts for items the user chose
- Appointment or webinar reminders
- Replies to a support ticket or comment
- Breaking updates for a topic the user followed
Messages that cause unsubscribes
- Generic "We miss you!" blasts
- Daily promotions with no personal relevance
- Notifications sent late at night in the user's time zone
- Vague headlines that do not say what is inside
Keep messages short: a clear title, one line of detail and a link that lands exactly where the notification promised.
Real-World Example: An Online Store With Back-in-Stock Alerts
Consider an illustrative scenario. A mid-sized ecommerce store frequently sells out of popular sizes. Visitors land on an out-of-stock product page, leave and buy elsewhere. The store does not want to force account creation just to capture interest.
A web push setup for this store might work like this:
- On out-of-stock pages, a button reads "Notify me when it is back."
- Tapping it shows a short explanation, then the browser permission prompt.
- The subscription is stored along with the product and size the visitor wanted.
- When inventory updates, an automated job sends a notification only to those subscribers, linking straight to the product page.
In a setup like this, the store could recover some sales that would otherwise be lost, and because each alert is something the visitor asked for, permission feels like a service rather than an interruption. Stores building on our ecommerce development experience often combine this with order tracking alerts.
Step-by-Step Implementation Process
- Define use cases. List the specific moments where a notification genuinely helps the visitor. If you cannot name at least two, wait.
- Generate VAPID keys. Create a public and private key pair that identifies your server to push services. Keep the private key in a secure secrets store.
- Register a service worker. Add a service worker that listens for push events and displays notifications, and handles clicks by opening the right URL.
- Build the soft prompt. Design an in-page prompt tied to each use case, with clear wording about what the visitor will receive.
- Request permission and subscribe. On agreement, request browser permission and create a push subscription.
- Store subscriptions with context. Save the endpoint, keys, topics or products the user chose and their time zone. Link to a user account only if they are logged in.
- Build the sending service. Create a backend job or queue that sends targeted messages, respects quiet hours and limits frequency per subscriber.
- Handle expired subscriptions. When a push service reports a subscription as gone, remove it so your list stays clean.
- Offer easy controls. Add a notification preferences page where users can change topics or turn notifications off.
- Measure and iterate. Track opt-in rate, click rate, unsubscribes and the conversions each notification type drives.
Our web development team usually builds this as a small, self-contained module so it can be added to an existing site without a redesign.
Privacy and Consent Considerations
The browser permission prompt is consent to receive notifications, but it is not a blank cheque. Explain clearly what you will send, keep subscription data minimal and avoid linking push subscriptions to tracking profiles without proper consent. If your site already runs a consent banner, make sure push prompts do not stack on top of it on first load. Our guide to cookie consent and analytics compliance covers how to keep that first visit clean.
Measuring Success
Focus on metrics that reflect real value, not just volume:
- Opt-in rate of visitors who saw the soft prompt
- Click-through rate by notification type
- Unsubscribe and block rates after each campaign
- Downstream conversions, such as purchases or bookings, attributed to push clicks
If unsubscribes rise after a type of message, stop sending it. A smaller, engaged subscriber list is worth more than a large, annoyed one.
Build It Yourself or Use a Push Service?
You have two broad options for running web push:
- Third-party push platforms give you a script to paste, a dashboard for campaigns and built-in analytics. They are quick to start with and suit marketing teams that want to send campaigns without developer help. The trade-offs are a monthly fee that often grows with subscriber count, less control over data and a dependency on another vendor's scripts loading on every page.
- A self-built module uses open standards (service workers, the Push API and VAPID) and an open-source library on your backend. It takes more setup but gives you full control over targeting, data storage and integration with your own order, inventory or CRM systems.
A practical rule: if your notifications are mostly marketing campaigns, a platform may be enough. If they are triggered by events in your own systems, such as order status or stock changes, building the module yourself usually pays off.
Common Mistakes to Avoid
- Prompting on first load: This trains visitors to block your site before they know what you offer.
- Broadcasting to everyone: Sending the same message to every subscriber ignores what each person signed up for.
- Ignoring frequency caps: Even relevant messages become annoying when they arrive several times a day.
- Broken landing pages: A notification that opens a generic homepage instead of the promised product wastes the click.
- Forgetting cleanup: Keeping expired subscriptions inflates your numbers and slows down sending jobs.
- No unsubscribe path: If users cannot easily turn notifications off in your site, they will block them in the browser instead.
Key Benefits of Web Push Notifications
- No app required: Reach visitors directly through the browser.
- No personal data needed: Visitors can subscribe without sharing an email or phone number.
- Timely delivery: Ideal for alerts where minutes matter, like stock or delivery updates.
- Low running cost: Sending is inexpensive compared with SMS.
- Works with PWAs: Strengthens a progressive web app strategy on mobile.
Web push works when every notification answers the question the visitor already asked. Anything else is noise.
Conclusion
Web push notifications are one of the simplest ways to bring back visitors who already showed interest, without asking them to install an app or hand over personal details. The technology is mature. The difference between success and a wall of blocked prompts is strategy: ask at the right moment, send only what people asked for and give them easy control. Build it as a focused module, measure carefully and let your visitors' behaviour guide what you send next.
Frequently Asked Questions
- What are web push notifications?
- Web push notifications are messages a website can send to a user's browser or device after the user grants permission, even when the site is not open. They use service workers and the browser's push service, so no app install is needed.
- Do web push notifications work on iPhone?
- Yes, with conditions. Safari on iOS supports web push for web apps that the user has added to their home screen. On desktop and Android browsers, support is broader. Always check current browser support for your audience.
- When should a website ask for push permission?
- Ask after the visitor shows intent, such as tracking an order, saving a search or following a topic. Show your own soft prompt explaining the value first, then trigger the browser prompt only if they agree. Asking on the first page load usually leads to blocks.
- Are web push notifications good for SEO?
- Push notifications do not directly affect search rankings. They help you bring back visitors who already found you, which complements SEO rather than replacing it.
- Do I need consent to send web push notifications?
- The browser permission itself is a form of consent, but you should still explain what you will send, offer easy unsubscribe options and follow applicable privacy laws for any data you link to a subscription.