No results for ""
EXPAND ALL
  • Home
  • API docs

Metric events

Read time: 4 minutes
Last edited: Nov 19, 2024

Overview

This topic explains the different metric event types and which SDKs they are compatible with.

An "event" happens when an end user takes an action in your app, such as clicking on a button, or when a system takes an action, such as loading a page. Your SDKs send these events to LaunchDarkly, where LaunchDarkly metrics can aggregate and analyze them. LaunchDarkly can then quantify the overall performance and health of your product and provide suggestions on how to respond.

Types of metric events

There are three types of metric events:

  • custom events are produced by custom conversion binary, custom conversion count, and custom numeric metrics
    • Conversion 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
  • click events are produced by clicked or tapped metrics
  • page view events are produced by page viewed metrics

You can send custom events using the track feature in your SDK. To learn more about event kinds, read Event kinds. To learn more about Experimentation events, read Experimentation and metric events.

Try it in your SDK: Sending custom events

SDK compatibility

The following table explains the kinds of events you can track with a metric and their SDK compatibility:

Event kindMetricDescriptionSDK compatibility
CustomConversion binary

Tracks events for any arbitrary event.

All
CustomConversion count

Counts events for any arbitrary event.

All
CustomNumeric

Tracks increases or decreases in numeric value against a baseline you set.

All
Clicked or tappedConversion

Tracks the clicks on a user interface (UI) element.

Electron
JavaScript
Node.js (client-side)
React Web
Vue
Page viewedConversion

Tracks how many times a page is viewed.

Electron
JavaScript
Node.js (client-side)
React Web
Vue

To learn more about different metric types and when to use them, read Choose a metric type.

For examples of common metrics and how to configure them, read Example metrics.

Metric event activity

The metric event activity tab provides visibility into the events LaunchDarkly is receiving for a given metric.

The activity tab includes information for the most recently received event, and for the last 100 events received within two hours of that event.

For each event, the activity tab displays:

  • Timestamp: when the metric received the event.
  • Context key: the key of the context that generated the event.
  • Value: for custom numeric metrics, the numeric value of the event.

To view more information about a specific event, click on the event row. An "Event details" dialog appears:

Details for a metric event.
Details for a metric event.

Event keys

Event keys and metric keys are different

Sending custom events to LaunchDarkly requires a unique event key. You can set the event key to anything you want. Adding this event key to your codebase lets your SDK track actions customers take in your app as events. To learn more, read Sending custom events.

LaunchDarkly also automatically generates a metric key when you create a metric. You only use the metric key to identify the metric in API calls. To learn more, read Creating and managing metrics.

LaunchDarkly SDKs track actions customers take in your app as events and sends them to LaunchDarkly. Events are specific to one LaunchDarkly environment.

An event key is a unique identifier you set for a particular kind of event within your app. You can set an event key to anything you want. When you are using metrics, the event key in your metric and the event key in your code must match exactly. To learn more, read Sending custom events.