How to send Transactional Web Push Notifications?

To send push notifications to a specific user, you can use our REST API. For example, transactional push notifications are used by SaaS applications to alert a specific user about their renewal dates, or specific message about his account.

Here is a how-to guide to implementing transactional web push notifications with a sample use-case. It’s simple!

Use Case – Adding Web Push to a Simple Web-App.

Step 1 – Enabling the subscription prompt

Add the Engagespot Javascript code to the pages where you’d like to show the subscription prompt. For SaaS apps, right after login is the best time to ask for the subscription. You can include a message (to inform them why they should enable push notifications) by changing the prompt message on your Engagespot Dashboard -> Website Settings -> Customize

Step 2 – Mapping your internal user to the push subscriber

Every user who subscribes to push notification will have a subscriber id. You need to your users internal id to this push subscriber. For that you can call the Engagespot.identifyUser('<YOUR_USER_IDENTIFIER>') function on our Javascript SDK. You can call this function on the page where user logins.

Remember to call the Engagespot.clearUser() function on the logout page.

Step 3 – Sending the notification

Now you have the subscriber id of every user who has enabled notifications on their browser. So whenever you need to send a push notification to this user, use our REST API with send_to parameter as identifiers and a separate identifiers JSON array.

Did this help answer your question?

thumbs up
thumbs down

Thanks for the feedback! 🙏🏽

Help by drift