How to send web push notifications in automations

To use web push notifications in automations, first, add web push notification code to the 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 segmentation and personalization of web push notifications

Method 1

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

<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 the user's subscription 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" check box.

How to use web push notifications in automations

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

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

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

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

The SendPulse account with a free tariff plan allows creating five events. If you need to create more than five events, choose one of the paid tariffs.

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

An example of an automation with a web push notification

We describe a welcoming campaign for a new subscriber as an example of an automation with 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 in what time 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 in what time 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