Skip to content

Create a Flag

To create a flag, first navigate to the "Flags" screen in the left navigation bar.

  1. From the Flags screen in Experiment, select your target project from the dropdowns.
  2. Click Create Flag.
  3. Enter a Name for the flag.
  4. Experiment will automatically generate a normalized Key for your flag/experiment. The key is the string which is used to access the variant in your application. You may choose to customize this key, as once the key is set it can't be changed.
  5. (Optional) Enter a Flag Description to better describe the flag.
  6. Save the experiment configuration. You can edit most fields from the flag's settings.

Add a deployment

Once you've created the flag, you can choose to use the default Amplitude project deployment, or add a custom deployment. Add one or more deployments using the Settings card.

Screenshot of settings card with deployments

Multiple Deployments

You may select multiple deployments in the dropdown if you want to target multiple deployments. For example, if you are running an experiment on both your iOS and Android apps, you should create separate deployments for each and select both in the multi-deployment experiment.

Define variants

After you have created your flag, you are ready to define its variants. A flag will contain an initial variant, "on", by default. If you are rolling out more than one variant of a feature, add variants using the Create Variant button. Make sure to add descriptions to your variants so that your team members can follow along.

Your flag must have at least one variant.

Screenshot of variants in configure tab

Experiment variants

By default, flags are created with a single "on" variant and experiments come with two default variants, "control" and "treatment".

Configure targeting rules

Your flag won't target any users by default. To target users, set the Percentage Rollout to 100%. Now all evaluated users will be assigned the "on" variant for this feature flag.

Screenshot of allocation card with percentage rollout

If you would like to target specific segments of users instead of all users, switch to the "Targeted Users" view and create your segments.

Screenshot of allocation card with targeted users control

If your flag has more than one variant, you will also be able to adjust distribution.

Screenshot of allocation card with distribution control

Activate the flag

Once you're done configuring your flag, activate the flag using the button in the upper right corner and follow the instructions in the activation modal.

Screenshot of top navigation bar with active toggle


Was this page helpful?