Documentation / Product / Integrations / Segment.com

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:

  1. Create an Identify or Track event payload with the Lytics user field data selected according to workflow configuration.
  2. Append the audience_{audience_name} as boolean (true or false) field if the event type selected at configuration is Identify. Here true specifies the Enter event and false specifies Exit event.
  3. If the Track event was selected at configuration, it will append the field event with a value of "enter" or "exit".
  4. 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.

  1. Navigate to the Integration page and click the Segment tile. segment-tile-215x215
  2. Select Workflows.
  3. Locate Segment.com export and click Select.
  4. Under Audience, select the audience or audiences to export to Segment.
  5. Provide your Segment write key in the Write Key textbox for the target Segment source.
  6. 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.
  7. 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.
  8. Select the type of the Event payload that will be sent to Segment.
  9. (Optional) Select the Lytics fields you would like to export to Segment. If no fields are selected, all will be sent. segment-export

Click Start Export to start sending events to Segment.