Segment to Courier
Courier’s Destination for Segment provides a straightforward way to send data from web or mobile applications into Courier to improve notification delivery and management. 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 ananalytics.identify event is received from Segment.
Supported Segment Events:
analytics.groupanalytics.identifyanalytics.track
Connecting Segment
- Log into the Segment app and navigate to the Destinations catalog page.
- Click Add Destination.
- Search for Courier in the Destinations Catalog and select the Courier destination.
- Choose the Source that should send data to the Courier destination.
- 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.
- Enter the Courier API Key or Auth Token in the API Key field of the Courier destination settings in Segment.
- 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.
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. See the Segment Identify spec and Courier Profiles API for details. Example PayloadTrack Calls
Segment Track calls allow you to record actions performed by your users, including any properties associated with their actions. See the Segment Track spec for details. Track events appear with a prefix oftrack/ 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:
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:- Double-check that your API Key was copied accurately into Segment.
- Check where the
emailproperty is placed within the test JSON object in Segment. If it is at the top level of an identify call, move it within thetraitsobject and resend the test event. - If you are still experiencing issues, please reach out to Courier Support.
Courier to Segment
You can also configure Courier as a Segment Source so that Courier message and audience events flow back into Segment for analytics.Setting Up Courier as a Segment Source
- In Segment, navigate to the Sources page (under “Connections”).
- Select your framework of choice (e.g., Node.js).
- Obtain a write key. After adding Node.js as a source, you’ll see a page with instructions on how to add Segment to your Node.js codebase. Copy the write key from this page.
- In Courier’s Segment configuration, paste your Segment Write Key in the Segment write key input field.
Courier Events Sent to Segment
When Courier is set up as a Segment source, the following events can be tracked in Segment:Message Events
Message ClickedMessage DeliveredMessage OpenedMessage SentMessage UndeliverableMessage Unroutable
Audience Events
Audience User MatchedAudience User Unmatched