• Home
  • Integrations
  • SDKs
  • Guides
  • API docs
No results for ""
EXPAND ALL

EDIT ON GITHUB

Creating metrics

Read time: 1 minute
Last edited: Jun 15, 2022

Overview

This topic explains how to create a metric to use within an experiment in LaunchDarkly.

Metrics are the measure against which you evaluate flag events. You can use metrics to track all kinds of things, from how often users 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.

You can also use the REST API: Metrics

Understanding types of metrics

You can use two different types of metrics to track experiment results in LaunchDarkly. They are:

  • Conversion metrics register events when a user takes an action based on a feature flag they encounter.
  • Numeric metrics measure numeric values against a baseline you set.

These metrics can track different kinds of user events, such as viewing a page or clicking on a link. There are four different types of metrics:

The following table explains the kinds of events you can track with a metric:

Event kindMetric typeDescriptionSDK compatibility
ClickConversionTracks the clicks on a user interface (UI) element. For example, how frequently a user clicks the Save button.JavaScript
React
CustomConversionTracks events for any arbitrary event. For example, whether a user search called a service or not.All
CustomNumericTracks increases or decreases in numeric value against a baseline you set. For example, how many items are in a user's cart when they check out of your online store.All
Page viewConversionTracks how many times a page is viewed. For example, how many times a blog post is viewed based on three different titles.JavaScript
React

To learn more about Experimentation events, read Experimentation events.

Connecting a metric to an experiment

After you create a metric, you can use it in an experiment. To learn how, 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:

  1. Navigate to the Experiments dashboard.
  2. Click the Metrics tab.
  3. Click the title of the metric you want to delete. The "Edit metric" panel appears.
  4. Click Delete this metric.

This metric is now deleted permanently across all environments in the project.

You can also use the REST API: Delete metric