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. Turn off the display of the agreement form
  3. 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 More information


2. Turn off the display of the agreement form

In order to send Web Push notifications, you need a confirmed consent from a user. First, you need to create such an agreement form (  More information ) and then you need to deactivate it.


3. 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:

Submit your review
1
2
3
4
5
Submit
     
Cancel

Create your own review

Average rating:  
 0 reviews