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

GIVE DOCS FEEDBACK

Using segments and targeting to manage early access programs

Read time: 13 minutes
Last edited: Apr 10, 2024
Segments are a Pro and Enterprise feature

Segments are available to customers on a Pro or Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

Overview

LaunchDarkly feature flags let you map flag targeting to your precise business needs. Flag and segment targeting can help you govern critical parts of user experiences, tailoring them to each audience segment and adapting them to changing conditions, without requiring custom code.

With custom targeting, you can do things like:

  • Target on your terms: Customize user experiences based on any attribute or combination of attributes with context-aware targeting, so that you deliver the right features to the right audiences. Easily manage hundreds of segments, see their impact, and manage their targeting across all of your flags in one place.
  • Automate feature entitlements: Grant the right users access to the right features based on customer tier, such as Premium, Basic, or Free, local regulations, account-specific parameters, and more.
  • Securely leverage predefined user groups: Utilize custom data sources like your own database or S3 storage to populate targeting segments. Or, choose from our external partners on our segments platform to sync audience data.

As an example of how you can use segments and targeting to meet your business needs, this guide provides strategies for managing early access programs (EAPs).

About early access programs

An EAP is a way to release a feature to a small subset of customers for early evaluation and testing. You can use EAPs to gather feedback from strategic stakeholders or users, gauge interest in the feature, create marketing opportunities, and build relationships with external stakeholders.

EAPs can be appropriate for highly innovative or highly demanded features, or other features where feedback from strategically chosen customers would be valuable.

Prerequisites

To complete this guide, you must have the following prerequisites:

Concepts

You should understand these concepts before you read this guide:

Segments

There are three kinds of LaunchDarkly segments:

To learn more, read Segments.

Context kinds

Some of the techniques in this guide limit your targeting to just one context kind. For early access programs, it's likely that you will be targeting on a context kind such as user or customer. If you need to target on more than one context kind, you cannot use large list-based segments.

To learn more, read Context kinds.

Initial planning

Before you begin building your EAP, consider the following questions:

  • Who are the key stakeholders and their roles/responsibilities/requirements? This might include product managers and engineers.
  • Who initiates EAP releases? This may be product managers or release managers.
  • Who approves EAP releases? This may be developers, SREs, product managers, or release managers.
  • Who should be notified of EAP releases? This includes internal staff and stakeholders including customer-facing teams.
  • What is the communication strategy for this kind of release?
    • Internal: Product managers might create an internal blog post for customer-facing account teams, including details on how to identify a good fit for this program.
    • External: Account teams might reach out to customers who are a good fit. Product managers can provide enablement resources for EAP features.
  • Which customers will be in the EAP? Decide criteria for good EAP candidates, who will communicate with those customers about the EAP.
  • How will you gather feedback on this release? Account teams might explicitly gather feedback from customers enrolled in the EAP, or you might create a feedback collection form.

Deciding on a segment type

There are four ways you can target your EAP customers within segments:

  • Segments synced with an external tool: We recommend this approach if you plan to manage your list of EAP customers in either of these tools.
  • Large list-based segments: We recommend this approach if you have a very large list of EAP customers you maintain outside of LaunchDarkly in a tool we don't provide automatic syncing with.
  • Rule-based segments: We recommend this approach if you want to target all customers that share a certain attribute.
  • Segments with individual targets: We recommend this approach if you have a very small number of customers in your EAP that can be managed manually.

No matter what method you use, we recommend adding an eap tag to your segments so it's easy to search for segments associated with an early access program.

Segments synced with an external tool

Synced segments require the Relay Proxy with server-side SDKs

If you are using server-side SDKs, then you must also be using the Relay Proxy and it must be configured to use synced segments. To learn more, read Implementing the Relay Proxy.

This method is our recommended approach to managing large EAPs if you use an external tool such as Amplitude or Segment.

Configure your SDK: Relay Proxy configuration

Creating and populating synced segments

To begin, you must create the segment in your external tool. We have provided examples using Amplitude and Segment here, but you can use any of our segment integrations.

LaunchDarkly supports syncing segments from the following tools:

  • Amplitude
  • Census
  • Fulcrum
  • Heap
  • Hightouch
  • RudderStack
  • Twilio Segment Audiences

Open each section below to learn how to create a segment synced with LaunchDarkly in either Amplitude or Segment:

Creating a segment that syncs with Amplitude

To configure a segment that syncs with an Amplitude cohort, you must choose a cohort in Amplitude and tell it to send data to LaunchDarkly. When you do this correctly, the cohort appears as a segment in LaunchDarkly.

To do this, first add LaunchDarkly as a destination and then sync the cohort to the LaunchDarkly destination.

To learn more, read Syncing segments from Amplitude cohorts.

Creating a segment that syncs with 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.

To learn more, read Syncing segments from Twilio Segment Audiences.

After you set up your synced segment it will appear automatically in LaunchDarkly in the Segments list. We recommend adding an eap tag the segment from the segment's Settings tab. To learn how, read about adding tags to segments.

Updating synced segments

To update the customers included in a synced segment, make the changes in your external tool. The changes will automatically sync with the segment in LaunchDarkly.

Large list-based segments

Large list-based segments require the Relay Proxy with server-side SDKs

If you are using server-side SDKs, then you must also be using the Relay Proxy and it must be configured to use big segments. To learn more, read Implementing the Relay Proxy.

Maintaining an external list of EAP customers allows you to have very large opt-in programs without impacting performance or payload size. You should use this option when you will have thousands of opt-ins to your program, and can export those opt-ins to a CSV file. This option requires that all of the targeted contexts are of the same context kind.

Creating and populating large list-based segments

Before you create and populate your segment, you must have a CSV file including all of the contexts to include in your EAP program. The context keys should be in the first column of the CSV file, and the file should not contain a header row.

To create and populate the segment:

  1. Navigate to the Segments list.
  2. Click Create segment. The "Create a segment" panel appears.
  3. Select Start with a list.
  4. Give your segment a human-readable Name. We recommend following a naming convention that includes "eap:" at the beginning of your segment name.
  5. Enter a Key for the segment. This field auto-populates based on the segment name, but you can change it if you need to.
  6. Add a Description including information about the EAP the segment is for.
  7. Select or create a new eap tag from the Tags menu.
  8. Select More than 15,000:
The list-based segment size selector in the segment creation dialog.
The list-based segment size selector in the segment creation dialog.
  1. Select a context kind.
  2. Click Save segment. An "Upload CSV" dialog appears.
  3. Click Select File.
  4. Select a CSV file to upload.
  5. Click Upload File.

You can also use the REST API: Create segment, Create big segment import

Updating large list-based segments

You can add to or overwrite the current list of contexts by uploading a new CSV file from the segment's Targeting tab. If you are merging contexts, they must be of all the same context kind.

When you upload the new CSV file:

  • Select "Overwrite" to replace all existing contexts in the segment
  • Select "Merge" to add to the existing contexts in the segment

Rule-based segments

You can target on any context attribute in a rule-based segment. For example, perhaps you capture customer sign-ups using a form, and store it in an attribute called eap-opt-in that your SDK passes in to LaunchDarkly. In this scenario, your segment would target anyone with an eap-opt-in attribute value of yes.

Creating and populating rule-based segments

To create the segment:

  1. Navigate to the Segments list.
  2. Click Create segment. The "Create a segment" dialog appears.
  3. In the "Select a method" step, choose Build dynamic conditions and rules.
  4. Click Next. The "Enter segment details" step appears.
  5. Give your segment a human-readable Name. We recommend following a naming convention that includes "eap:" at the beginning of your segment name.
  6. Enter a Key for your segment. This field auto-populates based on the segment name, but you can change it if you like.
  7. Add a Description including information about the EAP the segment is for.
  8. Select or create a new eap tag from the Tags menu.
  9. Click Save segment. The segment's Targeting tab appears.

To add targeting rules:

  1. In the "Include targets who match these rules" section, click + Add rule.
  2. Specify a Context kind.
  3. Select an Attribute. This example uses eap-opt-in.
  4. Choose an Operator. This examples uses "is one of."
  5. Enter Values for the rule. This examples uses yes.
  6. If you want to add more criteria, click the + beside the rule criteria.
A rule on a segment.
A rule on a segment.
  1. Include all targets.
  2. Click Save changes.

Now all contexts that match the targeting rule will be included in the EAP.

Another approach, if you have multiple EAPs running concurrently, is to store multiple attribute values in your eap-opt-in attribute. For example, if you are running two different EAPs, the flag controlling the first EAP could target on eap-opt-in attributes with a value of eap1, and the flag controlling the second EAP could target on eap-opt-in attributes with a value of eap2. You can then pass in an array of values for customers that are in both EAPs.

Configure your SDK: User and context configuration

Updating rule-based segments

To update a rule-based segment, navigate to the segment's Targeting tab and edit the existing rule, or add a new rule. Be sure you are passing in the desired context attribute values from your SDK.

You can also use the REST API: Patch segment

Segments with individual targets

You can use individual targets to implement small EAPs. Individual targets on a flag have the advantage of supporting approvals and keeping the list of EAP users visible directly from the flag targeting page. Use individual targets when you have a smaller number of opt-ins and want to avoid the cost of implementing your own external list.

Creating and populating segments with individual targets

To create the segment:

  1. Navigate to the Segments list.
  2. Click Create segment. The "Create a segment" panel appears.
  3. Select Start with a list.
  4. Give your segment a human-readable Name. We recommend following a naming convention that includes "eap:" at the beginning of your segment name.
  5. Enter a Key for the segment. This field auto-populates based on the segment name, but you can change it if you need to.
  6. Add a Description including information about the EAP the segment is for.
  7. Select or create a new eap tag from the Tags menu.
  8. Select the 15,000 or fewer option.
  9. Click Save segment. The segment's Targeting tab appears.

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

To add EAP members to the segment:

  1. Navigate to the segment's Targeting tab.
  2. If you want to add user contexts, choose contexts to include in or exclude from the segment.
  • You can search for contexts by name or key. Then, click the context name or key.
  • If you want to target a context that has not yet been encountered by LaunchDarkly, enter its key.
  1. (Optional) If you want to add context kinds other than user:
  • Click Edit context in the "Included targets" section.
  • Choose one or more context kinds and click Save. The "Individual targets" section updates to display the context kinds you selected.
  • Add individual targets by name or key.
  1. Click Save. The contexts are now individually targeted within the segment.

You can also use the REST API: Create segment

Updating segments with individual targets

To view or add new customers to the EAP, navigate to the segment's Targeting tab and view or edit the "Individual targets" section.

To remove a member from the segment, click the "x" next to the context in the "Individual targets" section and save your changes.

You can also use the REST API: Patch segment

After you create your EAP segments, you can target the EAP segment in your EAP-related flags using a targeting rule. Targeting a segment, rather than creating individual targeting rules for each flag, ensures you're targeting the exact same contexts every time and eliminates the need to update multiple targeting rules in multiple flags if something changes.

To target segments:

  1. Navigate to the flag's Targeting tab.
  2. Find the "Target segments" card and click Get started:
The Target segments card on the flag's "Targeting" tab.
  1. (Optional) Enter a name for the rule. We recommend including "EAP" in the name.
  2. In the Operator menu, select "is in."
  3. In the Segments menu, enter or select the EAP segments you want to target.
  4. In the Rollout field, select the variation to serve.
  5. Click Review and save.

Here is an example of a targeting rule for segments:

A targeting rule for segments.
A targeting rule for segments.

You can also use the REST API: Update feature flag

Finding active EAPs

To view which flags are using an EAP segment, navigate to the segment's Overview tab. The Overview tab displays how many flags target the segment and which variations the flags are serving.

A segment's "Overview" tab.
A segment's "Overview" tab.

Anyone with the build-in Writer role can edit segments. If you want to create a custom role with permission to edit only EAP-related segments, you can accomplish this using either a standard naming convention or eap tags.

Standard naming convention

To limit edit access to segments using a naming convention:

  1. Ensure all of your EAP segment names begin with eap-. You can edit existing segments to update their names if needed.
  2. In your custom role, add the following permissions:
[
{
"resources": ["proj/*:env/*:segment/eap-*"],
"actions": ["*"],
"effect": "allow"
}
]

Any members with this permission in their custom role will be able to edit EAP segments.

EAP tag

To limit edit access to segments with an eap tag:

  1. Ensure all of your EAP segments are tagged with an eap tag.
  2. In your custom role, add the following permissions:
[
{
"resources": ["proj/*:env/*:segment/*;eap"],
"actions": ["*"],
"effect": "allow"
}
]

Any members with this permission in their custom role will able to edit segments tagged with eap.

Conclusion

In this guide, you learned about managing early access programs using segments and targeting. LaunchDarkly offers a variety of segment types to easily manage and target your EAP customers, no matter the program size. For more examples of how segments and targeting can help you meet your business needs, read Using entitlements to manage customer experience.

Want to know more? Start a trial.

Your 14-day trial begins as soon as you sign up. Learn to use LaunchDarkly with the app's built-in tutorial. You'll discover how easy it is to manage the whole feature lifecycle from concept to launch to control.

Want to try it out? Start a trial.