No results for ""
EXPAND ALL
  • Home
  • API docs

GIVE DOCS FEEDBACK

Syncing segments from Twilio Segment Audiences

Read time: 4 minutes
Last edited: Mar 20, 2024
Syncing segments is an Enterprise feature

Syncing segments from Twilio Segment Audiences is available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

Overview

This topic explains how to create segments that sync with a Twilio Segment Audience. Segment syncing lets you import audiences from Twilio Segment to LaunchDarkly to more efficiently target and deliver feature flags.

The primary benefit of syncing segments with Twilio Segment is the automatic syncing between Twilio Segment and LaunchDarkly. This lets you concentrate more on deploying features and less on managing end users between platforms. You can connect a new or existing Twilio Segment Audience to LaunchDarkly. LaunchDarkly interprets each Audience as a segment.

The prerequisites for synced segments apply.

Prerequisites

In order to sync segments, you must meet the following prerequisites:

  • You must have a Twilio Segment account with the Engage Audiences feature enabled. Contact your Twilio Segment Customer Success Manager to enable the Engage Audiences feature.
  • You must have a Twilio Segment role that allows you to create destination connections and Engage Audiences. To learn more, read Roles.
  • You must have a LaunchDarkly access token with write access for the project you want to connect to Twilio Segment. To learn more, read Configure an access token.
  • You must have a LaunchDarkly client-side ID for the environment you want to connect to Twilio Segment. To learn more, read Copying your LaunchDarkly client-side ID.
  • If you are using server-side SDKs, or client-side SDKs with the Relay Proxy, there are additional prerequisites.

Creating a segment that syncs with Twilio Segment

To configure a segment that syncs with a Twilio Segment Audience, you must choose an Audience in Twilio Segment and configure it to use the LaunchDarkly Audiences destination. When you do this, the cohort appears as a segment in LaunchDarkly.

To do this, your will need to first configure the LaunchDarkly Audiences destination and then add the LaunchDarkly Audiences destination as a Twilio Segment Audience.

Configuring the LaunchDarkly Audiences destination

To add LaunchDarkly as an Audiences destination:

  1. Sign in to Twilio Segment and navigate to the Connections tab.
  2. Navigate to the Catalog tab and search for LaunchDarkly Audiences.
  3. Click Add destination.
  4. Select an existing Engage space as the data source. If you do not have an existing Engage space, follow Twilio Engage Foundations Onboarding Guide.
  5. Click Confirm source.
  6. On the Basic settings page, provide a human-readable Name for the destination. Because each instance of a LaunchDarkly Audiences destination can only sync to a single project and environment in LaunchDarkly, we recommend including project and environment information in the name.
  7. Enter the service token you created previously in the LaunchDarkly Service Token field.
  8. In the LaunchDarkly client-side ID field, enter the client-side ID corresponding to the environment where your synced segment will be created in LaunchDarkly. To learn more, read Copying your LaunchDarkly client-side ID.
  9. Click the Enable Destination toggle.
The LaunchDarkly Audiences destination "Basic settings" page in Twilio Segment.
The LaunchDarkly Audiences destination "Basic settings" page in Twilio Segment.
  1. Navigate to the Mappings tab of your LaunchDarkly Audiences destination configuration.
  2. Click New Mapping.
  3. Select the Sync Engage Audience to LaunchDarkly pre-built mapping.
The "Add Mapping" modal in Twilio Segment with the "Sync Engage Audience to LaunchDarkly" mapping highlighted.
The "Add Mapping" modal in Twilio Segment with the "Sync Engage Audience to LaunchDarkly" mapping highlighted.
  1. Scroll to Select mappings and modify the following settings as needed:

    • Context kind: The LaunchDarkly context kind for the LaunchDarkly synced segment. The default value is user. For more information, read Context kinds.
    • Context key: The Twilio Segment audience property that will be used as the context key. For most customers, the default value of Use Segment UserId only is recommended.
    • Enable batching: Select Yes.
The "Select mappings" section of the "Edit: Sync Engage Audience to LaunchDarkly" in Twilio Segment configured with recommended settings.
The "Select mappings" section of the "Edit: Sync Engage Audience to LaunchDarkly" in Twilio Segment configured with recommended settings.
  1. Click Save.
  2. Ensure the Status toggle on the Mappings tab is enabled.
The "Mappings" tab of the LaunchDarkly Audiences page in Twilio segment with the "Sync Engage Audience to LaunchDarkly mapping" enabled.
The "Mappings" tab of the LaunchDarkly Audiences page in Twilio segment with the "Sync Engage Audience to LaunchDarkly mapping" enabled.

Adding the LaunchDarkly Audiences destination as a Twilio Segment Audience

To add the LaunchDarkly Audiences destination to your Twilio Segment Audience:

  1. Navigate to the Audiences page in Twilio Segment and select the Audience you would like to sync with LaunchDarkly.
  2. In the Destinations section of the Audience page, select Add destination.
  3. Select the LaunchDarkly Audiences destination that you configured previously.
  4. Click Save. The default values for Send Identify and Send Track are appropriate.
  5. Click Add 1 destination.
  6. Verify that your Audience now displays your LaunchDarkly Audiences destination as a synced destination.
An example Twilio Segment Audience page configured with a successfully configured LaunchDarkly Audiences destination highlighted.
An example Twilio Segment Audience page configured with a successfully configured LaunchDarkly Audiences destination highlighted.
  1. The first sync will start about ten minutes after adding the LaunchDarkly Audiences destination. A new LaunchDarkly segment will be created automatically. Navigate to the Segments tab in LaunchDarkly to verify your new synced segment exists in LaunchDarkly. The segment's name will be the same as the Twilio Segment Audience's name.
An example LaunchDarkly segment synced from a Twilio Segment Audience.
An example LaunchDarkly segment synced from a Twilio Segment Audience.