Skip to main content
Web push notifications re-engage Users with timely content — even when they’re not actively browsing your website. They support rich content including text, images, action buttons, and sounds.
Web push notification examples across different browsers and devices
For web push to work:
  • HTTPS website: Web push only works on secure sites with a valid SSL certificate
  • Service worker: You must be able to add the OneSignal service worker to your website
  • Single domain origin: Must follow the same-origin policy
  • User permission: Users must explicitly grant permission to receive notifications
  • Supported browsers: Works across most modern browsers (Chrome, Firefox, Safari, Edge)
Users cannot subscribe while in incognito or private browsing mode. iOS devices require additional setup (see Web push for iOS). Some browsers may have notification limits or require user interaction — see Web push FAQ.
This guide walks through every step from SDK setup to sending personalized push messages.

Web push developer guides

Before sending web push notifications, complete the following setup steps.
Not a developer? See Manage team members to invite a teammate with developer access to your OneSignal project.

Configuration options

Set up your website for web push in the OneSignal dashboard under Settings > Push & In-App > Web.
OneSignal dashboard showing web push platform activation in settings
Select the integration type that matches your site:
OneSignal dashboard showing integration type options: Typical Site, WordPress, and Custom Code
Site details:
  • Site Name: Used in default notification titles
  • Site URL: Must exactly match your domain origin (no paths or www mismatch)
  • Auto Resubscribe: Recommended — Automatically re-subscribes returning Users who cleared browser data
  • Default Icon URL: 256x256px image shown in notifications (if unset, a default bell icon is used)

Auto resubscribe

If Users clear their browser data, they stop receiving push notifications. Enable this option to automatically re-subscribe Users when they return to your site. See Subscriptions for more details.
OneSignal dashboard web push configuration settings showing site details and auto resubscribe option

Web permission prompts

Prompting Users for notification permission is critical for opt-in. You can customize the behavior and appearance of permission requests based on your setup.
Use clear messaging that explains the benefit, prompt Users at the right time (e.g., after engagement), and use a pre-prompt before triggering the native browser dialog.

Welcome notification

You can enable an optional confirmation push that’s sent immediately after a User subscribes. Typical and WordPress integrations can set this in the dashboard.
OneSignal dashboard showing welcome notification configuration with title, message, and URL fields
Custom Code integration uses the welcomeNotification object in the OneSignal.init function. See Web SDK reference for details. Why send welcome notifications?
  • Let Users know they’ve subscribed successfully
  • Show what future notifications will look like
  • Provide onboarding content or next steps

Users and Subscriptions

When a User subscribes to push, OneSignal automatically creates a unique Subscription tied to their browser and device. Web push Subscriptions are created when Users:
  • Grant permission for push notifications on your website using a specific browser and device
  • Return to your site after clearing browser data (if Auto Resubscribe is enabled)
  • Subscribe from a new browser or device
Each browser/device combination creates a separate Subscription. Incognito/private browsing mode cannot create Subscriptions. Web push Subscriptions remain anonymous until you assign them an External ID.
OneSignal dashboard Users page showing a list of Users with Subscription details

iOS support

Apple added web push support for iPhones and iPads running iOS 16.4+ with stricter requirements:
  • Users must add your site to their Home Screen
  • Permission prompts are shown only after that step
  • Notifications behave like native app alerts once enabled

Design web push notifications

Crafting effective push notifications involves more than text. Learn what elements are customizable and how to use them.
Annotated diagram showing the anatomy of a web push notification with customizable and browser-controlled elements
  1. Title: Attention-grabbing headline (recommended: under 50 characters)
  2. Message: Main notification content (recommended: under 120 characters)
  3. Icon: Your brand icon or notification-specific image (recommended: 256x256px PNG or JPG)
  4. Large image: Eye-catching visual content
  5. Action buttons: Call-to-action buttons
  6. Browser: The browser/app displaying the push
  7. Domain: Your site origin automatically set by the browser
  8. Timestamp and dismiss: Browser adds these controls
  9. More options: Browser-specific additional controls

Personalization and localization

Customize push messages to match each User’s preferences and language.

Configure web push behavior

Control how your push messages behave after sending — when they appear, how long they’re stored, and how Users interact.

Delivery, display, and dismiss settings

Click behavior

Control what happens when a User clicks a notification. By default: Clicking opens your homepage. Customize it:
  • Direct Users to a specific URL
  • Use UTM tracking
  • Suppress default behavior with ?_osp=do_not_open

Test your setup

Before launching, thoroughly test your web push implementation across devices and browsers.

Pre-launch checklist

  • SDK is correctly loaded with no console errors
  • Permission prompt appears and functions correctly
  • Test notification is sent and received
  • Icons and images render correctly
  • Service worker is registered and up to date
  • HTTPS certificate is valid

Analytics and troubleshooting

Measure notification performance and resolve common delivery issues.

Next steps


FAQ

Can Users subscribe to web push on iOS?

Yes, starting with iOS 16.4+. Users must first add your website to their Home Screen, then grant notification permission. See Web push for iOS for the full setup steps.

Why did a User stop receiving web push notifications?

The most common cause is that the User cleared their browser data, which removes the push Subscription. Enable Auto Resubscribe in your web push settings to automatically re-subscribe returning Users. See Subscriptions for details.

Do web push notifications work in incognito or private browsing mode?

No. Users cannot subscribe to web push while in incognito or private browsing mode. Subscriptions created in a normal session are not accessible in private mode.

What browsers support web push notifications?

Chrome, Firefox, Safari (macOS and iOS 16.4+), and Edge all support web push. Each browser may have different prompt behavior and notification display. See Web push FAQ for browser-specific details.

Why is my web push prompt not showing?

Common causes include: the site is not served over HTTPS, the service worker is not registered correctly, the User already granted or denied permission, or the User is in incognito mode. Check the browser console for errors and see Notifications not shown for a full checklist.