How to Send Web Push Notifications in Automations

To use automated web push notifications, first, add web push notification code to your site, configure passing additional variables from the site to the SendPulse service, and integrate the web push notifications with the SendPulse email service.

How to Pass Additional Variables for Segmenting and Personalizing Web Push Notifications

Method 1

After adding the web push notification code, add the following code to the site as another script:

<script type="text/javascript">
window.addEventListener('load', function() {
   oSpP.push("Name","Name_of_website_user");
   oSpP.push("Email","Email_of_website_user");
});
</script>

Where:

"Name," "Email," are variables’ names.

"Name_of_website_user", "Email_of_website_user" are the values ​​of these variables.

If a variable is added after a user subscribes to web push notifications, the information will be transmitted to the server, and the subscription record will be updated when the user re-enters the site.

Method 2

Add additional input fields to the site with the sp_push_custom_data class:

<input class="sp_push_custom_data" type="hidden" name="Variable 1" value="Data1">
<input class="sp_push_custom_data" type="hidden" name="Variable 2" value="Data2">

Where Variable 1 and Variable 2 are appropriate variables for personal data about a subscriber. For example: "Name", "Last name", "Email."

You can add as many lines with variables as you want. The data from them will be added to subscribers’ records in the web push service. That data will be used for personalization and segmentation of messages.

Both methods described above are applicable for all sites on any CMS.

How to Integrate Web Push Notifications with the SendPulse Email Service

In the section "EMAIL" open "Service settings." Go to the "Other settings" tab and select the "Web push integration" checkbox.

How to Use Web Push Notifications with Automations

Automations can be started by adding a contact to a mailing list or by an event.

To start an automation by event, go to the "Events manager" and create a new event.

After creating the event, a unique URL will be generated.

Configure sending data from the site to the generated URL by one of the POST methods. It is configured on the site's back end.

The SendPulse free plan allows you to create five events. If you need to create more than five events, choose one of the paid plans.

Web push notifications are only sent to contacts that subscribed to web push campaigns, and their web push subscriptions are associated with email addresses.

An Example of an Automated Web Push Notifications

Below is a welcome campaign for a new subscriber as an example of automating a web push notification. If the first email is opened, the next email in the flow is sent to the subscriber. If, after three days, the email is still not opened, the subscriber receives a web push notification.

Go to "EMAIL" - "Automations."

Click "Create new automation."

Fill in the campaign information.

In the editor, select  "Add subscriber" as the flow start condition.

Select a mailing list. The automation will launch for new contacts from this list.

Click "Apply."

Drag the "Email" element to the editor and connect it to the flow start.

Specify how long after adding a new subscriber to the mailing list, the email should be sent.

Write the subject line.

Select an email template.

Click "Apply."

Drag the "Condition" element into the editor and connect it to the "Email."

Select the condition of "Open."

Specify how many days to wait for the condition to be met.

Click "Apply."

Drag the "Push" element into the editor field and connect it with the "no" option.

Specify a title, text, and a notification link.

Click "Apply."

Drag the "Email" element into the editor field and connect it with the "yes" option.

Specify how long after opening the first email, the second email should be sent.

Write the subject line.

Select an email template.

Click "Apply."

The automation flow is ready. Click "Save and launch" to save the automation and launch it immediately. Click "Save and exit" to save the automation, but not to launch it.

Rate this article about "How to Send Web Push Notifications in Automations"

User Rating: 5 / 5 (1)

    Other useful articles

    Popular in Our Blog

    Try SendPulse today for free