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 user keys (IDs) that a feature can target. 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 individual accounts. For more dynamic targeting, refer to the Custom attributes guide. Segments are case sensitive.
For feature releases, you can use segments to:
-
Ensure quality testing: For example, you can release to your internal or outsourced QA team by creating a
qa_team
segment. -
Target employees for internal testing: For example, you can release to your entire company to test a feature or gather feedback by creating an
employees
segment. -
Plan your release strategy: For example, you can release to a group of customers who have expressed interest in a particular feature by creating a
beta_tester
segment.
These are a few examples that engineering and product development teams can consider to ensure safe and successful releases.
Creating a segment
When creating your segment, the segment name, description, owners, and tags can help you and your team later manage your segment. This information can be customized to your team's workflow.
To create a segment:
- 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.
3. When all of the details are in place, click Create. Your new segment appears in the Segments list.
Adding user keys to a segment
To add users keys to a segment:
- In the Environment dropdown, select a Split environment where the segment will be defined.
- Click Add definition. A new blank definition for the segment (for the selected environment) appears.
- In the User section, click Add user.
You can add user keys individually, or import a up to 10,000 user keys at a time by by file import.
Add user keys to a segment by file import
When adding user keys to a segment by importing them from a file, use a csv file (.csv file extension) that lists the user keys in a single column with no header.
Example csv file content:
id1
id2
id3
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 or file import can only include 10,000 new members at a time. Contact support if you need larger segments.
Comments
0 comments
Please sign in to leave a comment.