Adding the script confirming receiving Web Push notifications to any element on the website

Web Push notifications are short messages displayed on a recipient’s device. The condition that must be met, so the notification can be sent to the user is confirming the agreement form.

The script confirming receiving Web Push notifications can be added to any element on the website. In the effect, the user who clicks the element to which the script has been added will be subscribed to receiving Web Push notifications.


Main steps:

  1. Add the tracking code to the website
  2. Invoke function in JavaScript

1.  Add the tracking code to the website

The vast majority of features in the SALESmanago platform is based on the tracking code. This is also the case of Web Push notifications. To take advantage of this feature and also of the script confirming receiving Web Push notifications, you need to add the tracking code to your website.

>>Learn more how to add the tracking code


2. Invoke function in JavaScript

The next step is to invoke function in Java Script:

smWebPushConfirm()

An exemplary application of the function:

You can add invoked function to the button on the website, e.g.:

<button onclick=”smWebPushConfirm()”>
Show Web Push consent
</button>

When the button is styled, it will look like this: