Metrics
Read time: 4 minutes
Last edited: Sep 15, 2023
Metrics is available to customers on a Pro or Enterprise plan. To learn more, read about our pricing. To add Experimentation to your plan, contact Sales.
Overview
This topic explains how to create a metric to use within an experiment in LaunchDarkly.
Metrics measure audience behaviors affected by the flags in your experiments. You can use metrics to track all kinds of things, from how often customers access a URL to how long that URL takes to load a page. Create metrics that align with your business goals and connect them to your team's flags to track the impact of different flag variations over time.
To view your list of metrics, navigate to the Metrics list:

You can also use the REST API: Metrics
Understanding types of metrics
There are two main types of metrics in LaunchDarkly:
- Conversion/binary metrics register events when an end user takes an action based on a feature flag they encounter.
- Numeric metrics measure numeric values against a baseline you set. Numeric metrics can track the
custom
event kind. To learn more about event kinds, read Analytics events.
The following table explains the kinds of events you can track with a metric and their SDK compatibility:
Event kind | Metric | Description | SDK compatibility |
---|---|---|---|
Click | Conversion | Tracks the clicks on a user interface (UI) element. | JavaScript React |
Custom | Conversion | Tracks events for any arbitrary event. | All |
Custom | Numeric | Tracks increases or decreases in numeric value against a baseline you set. | All |
Page view | Conversion | Tracks how many times a page is viewed. | JavaScript React |
You can send custom
events using the track feature in your SDK. To learn more about Experimentation events, read Experimentation events.
Try it in your SDK: Sending custom events
Creating metrics
Click on the following links below to learn how to create each metric option:
- Click conversion metrics
- Custom conversion/binary metrics
- Custom numeric metrics
- Page view conversion metrics
Choosing metrics
You should choose a metric type that correctly measures the effect of a change on your customers or codebase. If you are unsure of what metric type to use, it may be helpful to begin by determining what kind of data you are trying to measure.
When you create a metric, you will map the new metric to a context kind you have marked as available for experiments:
To learn more, read Randomization units.
This table includes examples of different kinds of data you can measure with different metric types, and common randomization unit context kind mappings:
Metric type | Example uses | Example randomization unit context kind mappings |
---|---|---|
Click conversion | How often do customers click a "Save" button? | user |
Custom conversion | Do customer searches call a particular service? | user organization |
Custom numeric | How much do customers spend per transaction in my store? | user guest request |
Page view conversion | How many times do end users view a blog post? | user |
Connecting metrics to an experiment
After you create a metric, you can use it in one or more experiments. The randomization unit you map the metric to must match the context kind you want to randomize on.
In this example, the experiment has a randomization unit of user
. It is compatible with the chosen metric, because the metric can measure events from user
context kinds.

To learn more, read Building experiments.
Deleting metrics
You should delete a metric only when you are sure you will no longer use it in any experiments.
To delete a metric:
- Navigate to the Metrics list.
- Click the title of the metric you want to delete. The metric details screen opens.
- Click Delete.
This metric is now deleted permanently across all environments in the project.
You can also use the REST API: Delete metric