Setting Up Web Push Notifications on Your Website
ImportantWeb push token collection is only available for
HTTPSprotocol websites.
Selecting a Subscription Type
- Go to your account settings and select the Web Push tab.

- Select the subscription type:
- Double Opt-in. A double opt-in subscription. The advantage of this type is the ability to customize the appearance of the subscription and confirmation windows. In this case, a user will first see your customized window, and then the standard one.
- Single Opt-in. Allows users to subscribe with just one button click, without additional confirmation.
NoteGoogle Chrome may block intrusive subscription windows. To avoid potential limitations, select the Double Opt-in subscription.

Click the +Connect website button, then select the subscription type if your account has existing subscriptions.

New Website Adding
After selecting the subscription type, fill in the required fields Website URL and Website name.

NoteThe Website name field can be used to create dynamic segments, as well as for searching and filtering contacts within a list.
We recommend using original website names for each site or subscription page ā this will help you segment subscribers from different versions, even if they share the same domain.
Example:
sitename.com/enā My store EN (English website version)sitename.com/uaā My store UA (Ukrainian website version)

Service Worker Setup
Service Worker is a script that runs in the background on your device, even when you are not using the website or application.
NoteA Web Push token is issued per browser (through the Service Worker), not per device. A person using several browsers on the same device generates a separate token in each one. Two browsers on one device therefore create two separate subscriptions, and both of them can receive the same push.
The browser does not have to be open for delivery ā the Service Worker runs in the background wherever the operating system and the browser support it.
The Service Worker configuration includes three fields (filled in automatically):
- Path to the file ā the path to the directory on the website where the script file should be uploaded.
- File name ā the name of the file containing the code (will be generated in the Web Push Integration step.)
- Scope ā the scope within which the Service Worker can interact with the website content. It defines on which pages or in which directories of the website this Service Worker will be active.
Important
- When using a web push Service Worker together with a PWA (Progressive Web App) Service Worker, it is necessary to separate their scopes to avoid conflicts. A typical setup is to place the PWA Service Worker in the root directory of the website and the web push Service Worker in any other directory.
- The scope of the web push Service Worker is not limited to the pages where the script is active. It works on all pages of your website, even if they are not within the specified scope.

If you need to place the file in a different directory on the website, change the path to the Service Worker file.
NoteThe file path and scope must have the same base path, starting and ending with a slash
/. For example, if the path is/push/reteno/, then the scope must also start and end the same way, meaning it should also be/push/reteno/.
Web Push Certificates
If you already have a subscriber base, enter public and private keys in the corresponding fields. To receive new certificates, leave the fields blankāthe keys will be automatically generated along with the script for your website.

Legacy Browsers Support
Follow the link to configure Web Push subscriptions on Safari versions below 16.
NoteSending Web Push notifications in Safari is only available in the Advanced plan

Web Push Integration
It consists of the following steps:
- Generating and integrating the script
- Checking the website status
Let's take a closer look at these steps
Generating and Integrating the Script

Click Generate script and follow these steps:
- Download the Service Worker installation file below and copy it to the
/push/reteno/directory on your website or to the directory specified in the File path field in the Service Worker settings. - Copy the generated code and insert it into the
<head>section of your website's HTML pages. - Create a manifest file, place it on your site, and connect it on HTML pages to enable sending messages to devices with iOS/iPadOS.

Checking the Connection Status
After uploading the installation file and adding the code to your website, click the Check website status button.

The Website connected status should appear in the settings. From this moment on, tokens will start to be collected.
NoteA new web push subscription is matched to an existing contact through a
CustomerDataevent carryingexternalCustomerId. If this event isn't sent right after the subscription is confirmed, the token attaches to a new (anonymous) contact instead of your existing one. See Setting Up Web Tracking for the event format.The Web Push script itself does not accept
externalCustomerIdā you can't bind a subscription to an external identifier at the subscription step. To send a Web Push to a specific contact, use the Send prepared message (smartsend) resource withcontactId: after the subscription, the contact ID is available in the browser's storage. The send works as long as the contact still has a valid web push token.We don't recommend assigning
externalCustomerIdto contacts whose only channel is a web push token: the token is unstable and can become invalid, and a contact left without any media channel is deleted automatically. The external identifier stays attached to that deleted contact and can no longer be assigned to another one.

Check the settings youāve made if you see Script not installed.

NoteSometimes, the website status may not be displayed due to the website providerās security policy. If the script is installed, ignore this status.
The Script not installed warning can also be a false positive when the script is added through Google Tag Manager ā the subscription can work correctly despite the warning.
Judge by the actual signals instead: the script loads (visible in the browser's Network tab), the Service Worker is registered, the browser shows the permission prompt and the subscription succeeds, and the subscriber base grows. Only if the functionality genuinely fails should you look for an
sw.js/ PWA Service Worker conflict or for errors in the Console and Network tabs.
Web Push Support on iOS/iPadOS in PWA
To enable Web Push notifications support on iOS/iPadOS devices in PWA (Progressive Web Apps), make sure that:
- the manifest file is placed on your website and available to the browser;
- the manifest is connected on the website's HTML pages in the
<head>section, for example:<link rel="manifest" href="/manifest.json">; - the manifest contains
"display": "standalone"or"display": "fullscreen". Ifdisplayis not specified, the browser usesbrowserby default, and Web Push on iOS/iPadOS may not work; - if the app should open from the website's home page, specify
"start_url": "/"in the manifest.
Placing the manifest in the root directory is not required.

NoteIf Web Push on iOS/iPadOS in PWA is not required, you can ignore the Manifest not found status.
Users can unsubscribe from web push in PWA through the browser/device notification settings or directly from a received push notification. A separate unsubscribe option inside the PWA itself is not required.
Click Set up subscription to go to the appearance settings of the subscription window, or Back to return to the general settings tab.

Learn more about customizing the appearance of the subscription window in a separate article.
Deleting Tokens
Enable the option to automatically delete inactive tokens after 30, 60, or 90 days to keep only those users who interact with the campaigns.
NoteA web push token is linked to a specific browser through its Service Worker, not to the device as a whole. The same user can therefore have several tokens on one device if they subscribed from different browsers.
Two browsers on one device create two separate subscriptions, and a push notification can arrive in both.
The browser does not have to be open for a message to be delivered: Service Worker runs in the background where the operating system and browser support it.

Editing Web Push Integration
To return to the integration settings, for example, to change the website name, re-upload the installation file, or copy the generated code, click the website link or the three dots icon and select Web Push integration.

In the same menu, you can delete or temporarily deactivate/reactivate the linked site.
If the site is deactivated, collecting subscribers for it is suspended and sending messages is impossible.
After activation, all functionality will become available again, all contacts will remain subscribed and with active tokens.
When you delete a site, all web push tokens collected on the site are deleted along with it.
Note
- To link a site, you can use the API resource Add web push domain.
- A site linked via the API is inactive by default ā it must be activated manually.
Updated 1 day ago
