Skip to main content

Courier as a Segment Destination

Courier's Destination for Segment provides an easy way to send data from web or mobile applications into Courier to improve notification delivery and management.

Segment supports Courier as a destination. Once you configure the Courier destination inside Segment, you can connect one or more sources, and events will flow into Courier. These events are visible on the Segment integration page inside Courier Studio, where you can map them to trigger notification workflows. For example, you can trigger an automation that welcomes a new user when an analytics.identify event is received from Segment.

Supported Segment Events:

  • analytics.group
  • analytics.identify
  • analytics.track

Connecting Segment

  1. Log into the Segment app and navigate to the Destinations catalog page.
  2. Click Add Destination.
  3. Search for Courier in the Destinations Catalog and select the Courier destination.
  4. Choose the Source that should send data to the Courier destination.
  5. In the Courier Integrations Page, search for Segment and click on it to access the Courier API Key. If you don't see a key here, go to the Courier Settings Page and copy the Auth Token from the API Keys section.
  6. Enter the Courier API Key or Auth Token in the API Key field of the Courier destination settings in Segment.
  7. To validate the setup, navigate to the destination's "Event Tester" in Segment and click "Send Event" at the bottom of the page. In Courier Studio, refresh the page or wait a few seconds. If the destination setup was successful, the test event will appear in the list.

Segment API

Identify Calls

Segment Identify calls allow you to connect a user to their actions (Segment events) and record traits about them. The user can be identified by their User ID and can hold additional traits such as their name and email. These traits can be used to update Courier recipient profiles over time.

Learn more about Segment Identify >

Learn more about Courier Profiles >

Track Calls

Segment Track calls allow you to record actions performed by your users, including any properties associated with their actions. The actions can be associated with properties that help you analyze these actions.

Learn more about Segment Track >

Track events appear with a prefix of track/ in Courier. Courier gathers data from the track's properties object. To send notifications based on a Segment event, these track events must be mapped to Courier Automations.

Here's an example Segment API call:

analytics.track('Login Button Clicked', {
messageId: "segment-test-message-a8rmf",
timestamp: "2021-12-07T08:41:59.410Z",
type: "track",
email: "test@example.org",
projectId: "4GgKeBoVJkT9EZL4vAmduv",
properties: {
property1: 1,
property2: "test",
property3: true
},
userId: "test-user-cqw3gr",
event: "Segment Test Event Name"
})

The associated JSON from the Segment API call will be sent to Courier as a track event:

{
"messageId": "segment-test-message-a8rmf",
"timestamp": "2021-12-07T08:41:59.410Z",
"type": "track",
"email": "test@example.org",
"projectId": "4GgKeBoVJkT9EZL4vAmduv",
"properties": {
"property1": 1,
"property2": "test",
"property3": true
},
"userId": "test-user-cqw3gr",
"event": "Segment Test Event Name"
}

The above JSON object is mapped into the Courier data object as follows:

{
"data": {
"property1": 1,
"property2": "test",
"property3": true
}
}

Troubleshooting

If you continue to see the "No Segment events received yet." message in Courier, it could mean that Segment was unable to successfully set up your Courier workspace as a destination. To ensure that the test event sent by Segment is successfully received by Courier:

  1. Double-check that your API Key was copied accurately into Segment.
  2. Check where the email property is placed within the test JSON object in Segment. If it is at the top level, move it within the properties object and resend the test event.
  3. If you are still experiencing issues, please reach out to Courier Support.
Was this helpful?