Use segments to create lists of keys that can be shared by feature flags in an environment. Segment your customer base to directly target these segments in your release process and re-use these segments across your feature flags. A segment is a pre-defined set of keys that a feature can be targeted to. These segments can:
- be imported from a file containing one key per line
- be edited via the API
- sync with any Amplitude Cohort
- use the Split user interface to manually add IDs to the segment
Segments are best for targeting relatively fixed or specific groups of users that you can easily identify, like individually targeted accounts. For more dynamic targeting, refer to the Custom attributes guide.
As you think about feature releases, take a step back and acknowledge all of the things that segmentation helps you do better. Use your segments to:
- Ensure quality testing: For example, if you want to release to your internal or outsourced QA team, create a
- Target employees for internal testing: For example, if you want to release to your entire company to test the feature or gather feedback, create an
- Plan your release strategy: For example, if you want to release to a group of customers who have expressed interest in a particular feature, create a
These are a few examples that engineering and product development teams should think about. There are more ways that you can apply segmentation to drive better results and ensure a successful and safe release.
Creating a segment
When creating your segment, you can specify information for your new segment, including name, description, owners, and tags. This information can help you and your team manage your segment and customize to your team's workflow. To create a segment, do the following:
- From the navigation bar, click Create segment. The Create a segment panel appears:
- Fill in the fields as follows:
- Name. Give your segment an easily recognizable name.
Segment name requirements
Segment names must start with a letter and can contain the characters - _ a-z A-Z 0-9. Note that segment names cannot specifically be called datetime, string, or integer.
- Traffic type. Select the traffic type you want to use this segment for.
- Owners. Add one or more owners to your segment. Use owners to isolate segments in the browse panes to those owned by me and simplify permissions by providing owner edit rights for a single segment across all environments by toggling permissions on. When toggled on, permissions inherit owners as editors.
- Tags. Optionally add one or more tags to help you categorize the segment. Use tags to isolate to a particular team or feature release, for example, reporting team, front end, or geo search release.
- Description. Optionally, provide a description of the segment. This helps your team members understand the segment's purpose.
- When all of the details are in place, click Create. Your new segment appears.
Add a definition
To use the segment in a given environment, click Add definition. From here, create and define customers within this segment.
After configuring the segment, begin adding customers to it.
Limit: Number of customers in a segment should not exceed 100,000
When you add customers to a segment, note that these are lists that need to be fully downloaded to all of our backend SDKs. Too many customers in a segment mean that your SDKs take longer to get ready. By default, you can't add more than 100,000 members to any one segment to avoid delays. Also, each call can only include 10,000 new members at a time. Contact support if you need larger segments.
Use your segments in your feature flag targeting rules to target a particular set of customers or a percentage of a particular set of customers.