• Home
  • Integrations
  • SDKs
  • Guides
  • API docs
No results for ""
EXPAND ALL

EDIT ON GITHUB

User segments

Read time: 2 minutes
Last edited: May 20, 2022

Overview

This topic explains how to build and manage user segments. User segments let you target groups of users by attribute.

Understanding user segments

User segments are lists of users that you can use to manage flag targeting behavior in bulk. Segments are useful for keeping groups of users, like beta-users or enterprise-customers, up to date. They allow you to more quickly turn features on or off for certain groups with confidence.

There are some differences between flag and segment targeting that you should be aware of:

  • Unlike flags, segments are environment-specific. They do not populate in environments other than the one you created them in.
  • Segment targeting cannot reference another user segment.

LaunchDarkly supports two types of segments:

  • Standard segments
  • Big Segments, including Big Segments synced with Amplitude

Understanding segment types

There are a few differences between Big Segments and standard segments.

These differences include:

  • Standard segments are built to support segments with 15,000 or fewer users. Big Segments are built to support millions of users. You cannot convert a segment from one kind to another after you create it, so choose the kind that best suits your use case when you create it.
  • A Big Segment is backed by an external data store and has additional prerequisites.
  • Big Segments support uploading users from a CSV.
  • Big Segments do not support user inclusion rules.

Using the Segments dashboard

You can view standard and Big Segments on the Segments dashboard.

From the dashboard, you can filter segments to display only those synced from Amplitude.

The "Segments" dashboard with the "Amplitude synced cohorts" filter applied.
The "Segments" dashboard with the "Amplitude synced cohorts" filter applied.

Creating user segments

To create a new segment:

  1. Navigate to the Segments dashboard.
  2. Click Create segment. The "Create a segment" panel appears:
The "Segments" tab with the "Create segment" button called out.
The "Segments" tab with the "Create segment" button called out.
  1. Give your segment a human-readable Name.
  2. Enter a Key for the segment. This field auto-populates based on the segment name, but you can change it if you need to.
  3. (Optional) Add a Description.
  4. (Optional) Choose Tags from the menu.
  5. Select the 15,000 or more users option to create a Big Segment.

Big Segments have different requirements and capabilities than standard segments. To learn more, read Understanding segment types

The "Create a segment" panel.
The "Create a segment" panel.
  1. Click Save segment. The segment's Targeting tab appears.

You can further edit the segment's settings from its Settings tab.

You can also use the REST API: Create segment

Converting a rule into a segment

You can convert a targeting rule into a segment from the flag's Targeting page.

Here is an image of the "Convert individual user targets to segment" dialog:

The "Convert to segment" dialog.
The "Convert to segment" dialog.

To convert a rule to a segment:

  1. Navigate to the flag's Targeting page.
  2. In the user targeting section or the rule matching section, click the overflow menu of the rule you wish to convert. The overflow menu appears.
  3. Click "Convert to segment". The "Convert to segment" window appears:
A flag rule, with the "Convert to segment" option called out.
A flag rule, with the "Convert to segment" option called out.
  1. Give your segment a human-readable Name.
  2. (Optional) Add a Description.
  3. (Optional) Choose any Tags from the menu menu.
  4. Click Save segment. A confirmation appears indicating that you've created a new segment.

After you click "Convert to segment", targeted users are cleared. A new segment rule targeting the newly created segment test-12345 appears at the top of the list of targeting rules.

Here is an image of the targeting section:

The targeting section, with the new segment called out.
The targeting section, with the new segment called out.

Here are the topics in this category:

  • Standard segments
  • Big Segments
  • Syncing Big Segments from Amplitude cohorts