With Iterable, you can send web push campaigns to Chrome, Firefox, and Opera web browers. Google's Firebase Cloud Messaging (FCM) delivers these messages.
In this article
- Getting started
Frequently asked questions
- 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.
To use web push, register for Google Firebase and follow these steps:
From the Firebase Console, create a project.
In the console, navigate to Project Settings > Cloud Messaging and take note of your Server key and Sender ID:
Integrating Firebase into your website
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.jsonfile should be the same across all projects. Please do not edit or change this.
- 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 you're working in an email-based project
and the user's email address isn't available (for example, if the user
hasn't logged in), you can leverage our
placeholder.emaildomain convention to pass Iterable a placeholder email address with the token. For more information, read Handling Anonymous Users.
- 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 Sending or Scheduling a Blast Campaign and Activating a Triggered Campaign.
Also take a look at the documentation for the
When creating a web push template, specify:
- Message Type — The message type to associate with your campaign.
- Title - Title text for the notification.
- Body - Body text for the notification.
- Icon - The image to display with the notification.
- Click Location - Where a click on the notification should navigate the user.
Frequently asked questions
Where can I find more information on Firebase?
Check out https://firebase.google.com/support/.
Which browsers does web push work on?
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.