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

Segment

Read time: 3 minutes
Last edited: Oct 16, 2024

Overview

This topic explains how to create and test a Segment destination for Data Export.

Prerequisites

There are two prerequisites to configure the Segment integration:

  • You must add the LaunchDarkly Source in Segment
  • You must find the Write Key for your Segment account

First, add the LaunchDarkly Source in Segment. To add the source, read Segment's documentation.

Next, configure the Segment integration in LaunchDarkly. To do this, you need the Write Key from your Segment account.

To find the write key:

  1. Log into Segment and navigate to your project.
  2. Navigate to Sources and select your LaunchDarkly source.
  3. Select API Keys on the Source integration's menu bar.
  4. Copy the Write Key as shown in the text box:
The API Keys section of Segment's UI.
The API Keys section of Segment's UI.

Create a Segment destination in LaunchDarkly

To create the Segment destination:

  1. Navigate to the Integrations page and find "Segment."
  2. Click Add integration. The "Create a destination" panel appears.
  3. (Optional) Give your integration a human-readable Name.
  4. Choose an Environment for this integration to apply to.
  5. Enter the Segment Write key.
  6. Click Save destination. The new integration appears in the list of integrations.

Test a Segment destination

After you save the destination, send a test event to confirm that the destination is configured properly.

To send a test event:

  1. Navigate to the Integrations page and find "Segment."
  2. Click into the "Segment" section to display a list of destinations.
  3. Click the pencil icon next to the destination you want to test. The "Edit destination" panel appears.
  4. In the "Send a test event" section, click Send event.
  5. Verify the event appears in the Segment Debugger.

Example events

These example events display the structure of the events LaunchDarkly sends to Segment.

LaunchDarkly sends events in the following formats:

Enable Data Export for flags and environments

After you create a Data Export destination, you must start sending flag or environment event data to it. You can enable Data Export for individual flags, or for all the flags in an environment.

To learn more, read Export event data for flags and environments.

Delete a Segment destination

You can delete a Data Export destination from the Integrations screen.

To delete a destination:

  1. Navigate to the Integrations page and find "Segment."
  2. Click into the "Segment" section to display a list of destinations.
  3. Click the pencil icon next to the destination you wish to delete. The "Edit destination" panel appears.
  4. Click Delete destination.