Segment: Export
With this export you can send Lytics audiences to Segment as Identify or Track events. Using Segment you can send this data downstream to multiple other tools. This document covers the following topics:
Integration Details
- Implementation Type: Server-side.
- Implementation Technique: REST APIs with audience triggers.
- Frequency: Real-time, with an optional one-time backfill of the audience after setup.
- Resulting Data: Lytics users that are a member of the selected audience(s) are exported to Segment via Identify or Track events.
This integration utilizes the Segment API to send user data. Once the user initiates the workflow, it will run a backfill of users if configured to do so. Segment will then receive real-time updates when a user enters or exits the choosen audience. For each user the integration will:
- Create an Identify or Track event payload with the Lytics user field data selected according to workflow configuration.
- Append the
audience_{audience_name}
as boolean (true or false) field if the event type selected at configuration is Identify. Heretrue
specifies the Enter event andfalse
specifies Exit event. - If the Track event was selected at configuration, it will append the field
event
with a value of"enter"
or"exit"
. - Send the Event to Segment.
Fields
Segment supports various fields for Identify or Track payload. Please refer to Segment's Identify and Track documentation for more information. As mentioned above, the audience_{audience_name}
and event
fields are added in addition to the default payload depending on the event type. Lytics allows you to send additional fields as part of traits for Identify events and properties field for Track events.
Configuration
Listed below are instructions on how to setup and configure the audience export to Segment.
Note: Before running this workflow you will need to set up a Source in your Segment account, this may be a Custom Source or a Legacy Project Source this will be the source where Lytics writes data in Segment. You will need to know your write key for your source. See Segment's documentation for directions on how to obtain your write key.
- Navigate to the Integration page and click the Segment tile.
- Select Workflows.
- Locate Segment.com export and click Select.
- Under Audience, select the audience or audiences to export to Segment.
- Provide your Segment write key in the Write Key textbox for the target Segment source.
- Select the field to be used as the user id from the UserID dropdown which will will match users in Segment. See Segment's documentation for more information about user ids.
- Select the field used as the anonymous id from the Anonymous ID dropdown. This will tie the date we are sending to segment as anonymous. See Segment's documentation about Anonymous IDs for more information. Note: User ID or Anonymous ID must be set.
- Select the type of the Event payload that will be sent to Segment.
- (Optional) Select the Lytics fields you would like to export to Segment. If no fields are selected, all will be sent.
Click Start Export to start sending events to Segment.