How To Send Notifications With Segment
Learn how to send browser and mobile push notifications using Segment and Courier.
Courier’s destination for Segment provides an easy way to send data from web or mobile applications into Courier to automate notification delivery and management. Event data can flow from your application through Segment’s integration into Courier.
Overview
How Courier API calls work with Segment:
- In your application, Segment identifies a user action and creates a track/identify API call.
- The Segment event API call sends the event to Courier
- Segment
properties
JSON data is passed into the Courier Send API as elements of thedata
JSON object - Segment’s
userId
is used to locate the recipient in Courier with the same ID or create a new one when none are found
- Segment
- Courier receives the event from Segment
- The event within Courier triggers any automations linked to it
- The linked automations run send any notifications that are linked to them
Sample Segment data payload:
Before Starting
Prior to sending notifications with Segment you will need the following:
- A Segment account
- A notification template configured with a downstream provider within Courier
- Segment integrated to Courier.
Learn more about Courier Automation concepts >
Linking Automations
Linking automations to Segment events allows you to create a flow of actions that will be triggered by specific events. This means that whenever an event occurs in your application and is sent through Segment, any linked Courier automations will trigger a workflow to send a notification with the data passed from the event.
-
In the Segment integration page, locate the event you want to link, click the + sign on the second column, and select the automation of your choice.
-
From an automation template, you can link an automation to a segment event from the dropdown menu.
Courier Automation Segment Dropdown
Additionally, refs.data.properties
points to the data object from Segment. refs.data.userid
references this data from Segment directly and auto populates the recipient ID in the automation send step (see Automation Send Step figure below). Below the recipient ID, add the “Profile” optional field with the following JSON to get the user’s email from the Segment data object: