> ## Documentation Index
> Fetch the complete documentation index at: https://docs.instantcampaign.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Web push notifications

> Send browser notifications to people who allowed them on your own website, from automations and alongside campaign emails. No per-message cost.

Web push lets you reach people on your own website with browser notifications: a short title, a line of text, an optional icon and a link. People opt in on your site, and you can then notify them from an automation step or alongside a campaign email.

> [!NOTE]
>
> Web push is available on the **Pro** and **Enterprise** plans. Push subscribers never count toward your contact limit or your bill, and there is no cost per notification.

## Set up web push

**1. Generate your keys and list your sites**

Go to **Settings → Web push**. Enter the sites that may ask visitors for permission, one per line (for example `https://shop.example.com`). Your workspace website from **Settings → General** is always allowed. Choose **Set up web push**. InstantCampaign generates your workspace's signing keys (VAPID). The private key is stored encrypted and is never shown.

**2. Put the service worker on your site**

Download `ic-push-sw.js` from the link in the install guide and serve it from the root of your site, for example `https://shop.example.com/ic-push-sw.js`. Browsers only deliver notifications to a worker on the same site as the page, so it cannot be loaded from InstantCampaign. If you serve it from another path, enter that path in the push prompt's settings.

**3. Optional: add a web app manifest**

Safari on iPhone and iPad only shows web push for sites added to the Home Screen, which needs a web app manifest. Start from the template in the install guide, change the name and icons, and link it from your pages with `<link rel="manifest" href="/manifest.webmanifest">`.

**4. Create a push prompt**

Go to **Forms**, create a form and choose the **Push prompt** display type. Write the message and the button labels visitors see. Use the targeting rules (pages, delay, scroll depth, exit intent, how often) to decide where and when the prompt appears.

**5. Add the prompt to your pages**

Copy the prompt's `popup.js` script from the form or from **Settings → Web push** into every page where it may appear.

## How visitors opt in

The prompt asks in two steps. Visitors first see your card with **Allow** and **Not now**. The browser's own permission dialog opens only after they choose **Allow**. A visitor who declines in the browser is not asked again by the browser.

After someone subscribes, InstantCampaign tries to match the browser to a contact:

* they arrived from a tracked link in one of your emails;
* their visit was already identified;
* they later submit any of your forms on that site.

If the browser cannot be matched yet, the prompt can show the form's fields straight away (**Then ask for the form's fields**). Campaigns and automations only reach subscribers who are matched to a contact. An email address typed into a page never matches a browser by itself.

## Send push from an automation

Add a **Send push** step to an automation. Enter a title, a text, the link that opens when the notification is clicked, and an optional icon. You can personalise the text with `{{first_name}}`, `{{last_name}}`, `{{company}}` and `{{workspace_name}}`, each with an optional fallback such as `{{first_name|there}}`. Email addresses are never offered, because notifications appear on lock screens.

You can also add:

* an **image** (an https address): a large picture under the text, shown by Chrome and Edge;
* one **button** with its own label and link, shown before **Notification settings**. A button needs both a label and an https link;
* **Keep on screen until dismissed**: desktop Chrome and Edge keep the notification until the person closes it.

Clicks on the button count as clicks on the notification.

Use **Send a test to this browser** to see the notification on your own device. Contacts without a live push subscription skip the step and continue the automation; the skip is recorded in the automation's logs.

## Send push with a campaign

On a campaign page, turn on **Also send as push**. The title, text and link start from email 1's subject, preheader and main button, and you can edit them. The notification goes out with each batch of emails, after the email, to the contacts in that batch who have a live push subscription. There are no stand-alone push campaigns.

## When the visitor is on your site

If a notification arrives while someone has your site open and in view, and the page carries the push prompt's `popup.js` script, it appears as a card on the page instead of a system notification. The card uses the prompt form's accent colour and position (bottom right for a centred prompt) and shows the title, text, icon, image and button, a close button and a **Notification settings** link. Clicking the card or its button opens the link in a new tab and counts as a click.

In the push prompt form's settings, **Show on the site as a card** turns this off (the system notification is then always shown) and **Card stays for (seconds)** sets how long the card stays (0 keeps it until the visitor closes it; default 8).

Browsers sometimes renew a subscription without telling the site. On every page load, and again whenever the visitor returns to the tab, the prompt script checks that the subscription InstantCampaign holds is still the browser's current one and sends the new one when it changed, keeping it attached to the same contact. The service worker does the same when the browser reports the change itself, so notifications keep arriving.

## Who receives push

Push follows your email consent: contacts who unsubscribed, bounced, complained or were sunset do not receive push either. Holdout groups also hold back push. Each notification has a **Notification settings** action that opens a page where the person can stop notifications from your site. Subscriptions that a browser has removed are marked expired the next time a notification is sent to them.

## Results

The campaign page and the automation's analytics panel show notifications **delivered** (accepted by the browser's push service), **clicked**, the click rate, **expired** and **not delivered**. **Settings → Web push** shows subscribers by site and totals for the workspace. Push is not counted in email metrics.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.