Skip to main content

Segment API

Identify Calls

Segment Identify calls allow you to connect a user to their actions (Segment events) and record traits to them - the user can be identified by their User ID and can hold additional traits such as their name, email, etc.

Learn more about Segment Identify >

Learn more about Courier Profiles >

Recipients

Courier recipients can be updated using Segment user profiles over time.

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 any 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.

The following is 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 following is the associated JSON object from the Segment API call:

{
"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 following is how the above JSON object is mapped into the Courier data object:

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

Troubleshooting:

If the email property isn’t being read into Courier, try to place email within the properties object.

Was this helpful?