Iterable's web push offering allows you to push blast and triggered notifications to subscribers using the Chrome, Firefox, or Opera browsers. Google's Firebase Cloud Messaging (FCM) service is used to deliver these messages. You can find more information about Firebase on their website.
A web push notification will resemble the following:
Table of contents
- Getting started
Frequently asked questions
- Does Firebase have any associated costs?
- Where can I find more information on Firebase?
- Which browsers does web push work on?
- Does a user's browser token change from session to session?
- If a user's browser window is closed, will they still receive the notification?
- Will messages be queued if they are unable to display initially?
- What metrics can I track with web push?
This section describes how to set up web push notifications in Iterable.
In order to leverage the web push service, you will first need to register for Google Firebase and then follow the steps below:
Create a project within the Firebase Console.
Within the console, navigate to Project Settings > Cloud Messaging and take note of your Server key and Sender ID:
Integrating Firebase into your website
In order to send messages from Firebase, you will need to first prompt users with a message asking for permission. If permission is given, you will retrieve the user's browser token and give it to Iterable to use for future sends.
To do this, follow these steps:
<link rel="manifest" href="/manifest.json"/>in the
<head>section of your webpage.
gcm_sender_id 103953800507found in the manifest.json file should be the same across all projects. Please do not edit or change this.
It should prompt the user with a pop-up asking for permission to send push notifications
If permission is granted, it should fetch the user's browser token and then pass it to Iterable using the
POST /api/users/registerBrowserTokenAPI endpoint.
A user profile field,
browserTokens, will then reflect the browser token value for each user who accepts notifications. This is an array, which is capable of accepting multiple values over time.
If the user's email address is not available (for example, if the user is not logged in), you may leverage our placeholder.email convention to pass Iterable a placeholder email address with the token.
- Browser tokens are managed and sometimes disabled by Firebase using their own algorithm. If Firebase determines a token to be outdated, you may need to re-prompt users for web push permission. Users who have not enabled browser tokens on their profiles will be suppressed from web push send attempts.
- If you have collected users' browser tokens in the past, you can import them
into Iterable using the same
POST /api/users/registerBrowserTokenAPI endpoint. API endpoint as mentioned in step 3, above.
Configuring your website to capture click metrics
In order to capture web push clicks in Iterable, call Iterable's
Connecting Your Firebase Instance to Iterable
In order to send messages from Firebase via Iterable, follow these instructions:
In Iterable, navigate to the Settings > Web Push.
Click Create Push Integration to add a new integration.
Iterable supports one web push integration per project.
Select FCM and enter your Firebase server key and sender ID (from step 2 of Configuring Firebase, above).
Creating Web Push Templates and Campaigns
To create a web push notification campaign, follow the same steps as for other campaign types: select the message format, send and suppression lists, and template. For more information, read:
Also take a look at the documentation for the
When creating a web push template, specify the following options:
- Template Name - The name of the template
- Notification Title - The text that should display at the top of the notification.
- Notification Body - The text that should display in the body of the notification.
- Icon - The image to display with the notification.
- Click Action - The URL to which the notification should navigate the user on click.
- Title or body contents are required in order to save the template. This acts as a safeguard against sending blank messages.
- Your project name will display under the title and body in the preview. In proofs and the live sends, however, this will display your website name (for example, "iterable.com").
Frequently asked questions
Does Firebase have any associated costs?
No, Firebase is free (as of September 2017).
Where can I find more information on Firebase?
See Google's Firebase support page here.
Which browsers does web push work on?
Currently, Chrome, Firefox, and Opera.
Does a user's browser token change from session to session?
If a user's browser window is closed, will they still receive the notification?
Yes. Even if the user closes the browser window, the service worker running in the background will display the notification. However, if the user quits out of the browser completely (not just the window or tab), then all service workers will be killed and they will receive no notification.
Will messages be queued if they are unable to display initially?
No. Messages will not deliver if the browser process isn't running at send time.
What metrics can I track with web push?
We support both web push send and click events. In order to track web push click events, you must configure your website to capture click metrics. Please see above for more information on how to track web push click events.