TechBuzzPro

How to Monitor Feature Flag Usage in Amplitude

· 6 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To monitor feature flag usage in Amplitude, you need to send flag exposure events into Amplitude and then analyze them with charts and cohorts. Amplitude does not automatically pull flag data from your flag provider, so the work is in the instrumentation: once each flag evaluation is logged as an event with properties such as flag key, variant, and user ID, you can track adoption, compare behavior by variant, and spot flags that are stale or misconfigured. This guide covers the setup and the analysis steps, plus the mistakes that make flag data misleading.

What You'll Need

  • An Amplitude account with permission to create events and charts (typically Admin or Manager role).
  • A feature flag system that can emit an evaluation or exposure event, either through its own Amplitude integration or through your application code.
  • The Amplitude SDK installed in your app, or the HTTP API if you send events server-side.
  • A naming convention for flag events and properties agreed with your engineering team before you start.

Step-by-Step

  1. Decide what counts as a flag exposure. Log an event when a user is actually exposed to a flag's effect, not every time the flag is evaluated in code. For example, log Feature Flag Exposed when the flag returns a variant that changes what the user sees. If you log every evaluation, including background checks that never affect the UI, your counts will be inflated and variant comparisons will be noisy.
  2. Choose an event naming scheme. Use one event name for all flags, such as Feature Flag Exposed, and put the flag identity in event properties. This keeps the event volume in Amplitude manageable and lets you group by property later. A separate event per flag becomes unmanageable once you have dozens of flags.
  3. Define the properties you will send. At minimum send flag_key (the flag's unique name), variant (the value the user received, such as control or treatment), and flag_source if you use more than one flag provider. Add environment (production, staging) so test traffic does not contaminate production charts. Keep property values lowercase and consistent; Treatment and treatment are different values in Amplitude.
  4. Instrument the client or server. If your flag provider offers a native Amplitude integration, enable it and map the flag key and variant fields to Amplitude event properties. If not, call the Amplitude SDK's track method immediately after your flag evaluation returns a value. On the client, use the same user ID that Amplitude already uses so flag data joins to your other events. On the server, use the HTTP API and pass the same user ID or device ID.
  5. Verify events are arriving. Open Amplitude, go to the event stream or user activity view, and trigger a flag exposure in your app. Confirm the event appears with the expected properties. If it does not, check the SDK initialization order: tracking calls made before the SDK finishes initializing can be dropped.
  6. Build a flag adoption chart. Create an Event Segmentation chart with Feature Flag Exposed as the event, group by flag_key, and set the date range to the period you care about. This shows which flags are actually reaching users. A flag with zero exposures after release is either not wired up or gated behind a condition that never fires.
  7. Compare outcomes by variant. Add a second event to the same chart, such as a conversion or retention event, and group by variant. This lets you see whether the treatment group behaves differently from control. Keep in mind this is observational data, not a randomized experiment, unless your flag system assigns variants randomly and you have confirmed that assignment is stable per user.
  8. Create a cohort of exposed users. Use Amplitude's cohort feature to define users who fired Feature Flag Exposed with a specific flag_key and variant. You can then use that cohort in other charts, funnels, or retention analyses to study the flag's population without rebuilding the filter each time.
  9. Set up a dashboard for ongoing monitoring. Add your flag charts to a dashboard and check it after each release. Include a chart that shows total exposures per flag over time so you can see when a flag stops being used, which usually means it is ready to be cleaned up.
  10. Review stale flags regularly. Sort flags by last exposure date. Any flag with no exposures for a defined period is a candidate for removal. Removing dead flags reduces the risk of accidentally toggling something that no longer has an owner.

Common Mistakes

  • Logging evaluations instead of exposures. This inflates counts and makes variant comparisons meaningless because users who never saw the feature are counted.
  • Inconsistent property values. Mixed casing, trailing spaces, or variant names that change between releases break grouping and make charts look empty or split.
  • Using different user IDs. If the flag event uses a different identifier than your other events, Amplitude cannot join them, and cohort and funnel analysis will not work.
  • Forgetting the environment property. Staging and production traffic mixed together produces numbers that do not reflect real users.
  • Assuming Amplitude pulls flag data automatically. It does not; without instrumentation, there is nothing to chart.

Tips

  • Send the flag exposure event as early as possible after the flag value is known, so it precedes the events it is meant to explain.
  • Keep a short internal registry of flag keys and their owners; it makes stale-flag reviews fast.
  • Use a single event name and group by property rather than creating one event per flag.
  • If you run true experiments, use your flag provider's experiment integration or Amplitude's experiment features rather than relying on manual variant logging.

Troubleshooting

If flag events do not appear in Amplitude, first confirm the SDK is initialized before your tracking call and that the event name matches exactly, including case. Check the event stream for the user you are testing with; events can take a short time to appear. If events arrive but properties are missing, inspect the payload your app sends and confirm the property names match what you filter on in charts. If charts show data but grouping by variant produces one bucket, your variant property is likely empty or identical for all users; verify the flag evaluation actually returns distinct values. If counts look too high, you are probably logging evaluations rather than exposures. If counts look too low, check that the tracking call is not inside a code path that only runs for a subset of users. For server-side sends, confirm the API key and that requests are not being blocked by a network rule.

Frequently Asked Questions

Does Amplitude automatically track feature flags?

No. Amplitude only records what you send it. You need to instrument flag exposures through your flag provider's integration or your own tracking code.

Should I use one event per flag or one event with properties?

One event with a flag key property is easier to maintain and chart. Separate events per flag become hard to manage as the number of flags grows.

Can I compare variants in Amplitude?

Yes, by grouping a chart by the variant property. This shows correlation, not causation, unless variants are randomly assigned and you have verified stable assignment.

Why are my flag events missing properties?

The most common causes are a property name mismatch, an empty value at send time, or tracking before the SDK is initialized. Check the raw event payload for the test user.

How do I find flags that are no longer used?

Chart exposures per flag over time and sort by last exposure. Flags with no recent exposures are candidates for removal after confirming with the owner.