Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This topic explains how to create a custom conversion binary metric in LaunchDarkly. Custom conversion binary metrics track how many contexts trigger an event. You can use this metric with any event you set up in your codebase. For example, you can use custom conversion binary metrics to track:- How many customers submitted a form
- How many customers made a successful payment
- How many customers encountered an error
Metric definition
When you create a custom conversion binary metric, you must first select Occurrence for what you want to measure. Then, custom conversion binary metric definition options include:- Percentage of [analysis unit] units that sent the event: one or more context kinds, such as “user,” “device,” or “request,” that the metric can measure events from.
- Success criteria:
- Higher is better: choose this option for metrics measuring positive things like cart checkouts or sign-ups.
- Lower is better: choose this option for metrics measuring negative things like errors.
Create custom conversion binary metrics
Custom conversion binary metrics require an event key from your application’s code to track conversions for any event in your code. To add a custom conversion binary metric in LaunchDarkly, you must identify it with a code snippet embedded in your app. This is an example of sending acustom event:
Try it in your SDK: Sending custom events
- Navigate to the Metrics list.
- Click Create metric. The “Create metric” dialog appears.
- If you use Snowflake native Experimentation, you have the option to select either LaunchDarkly hosted or Warehouse native.
- Select LaunchDarkly hosted to measure events from LaunchDarkly SDKs.
- Select Warehouse native to measure events from an external warehouse, such as Snowflake.
- Select an existing Metric data source or click + Create to create a new data source. To learn more, read Metric data sources.
- If you chose the LaunchDarkly hosted event source, select an event kind of Custom.
- Search for or enter an Event key.
- A list of events your environment has recently received appears when you click into the Event key field. Begin typing an event key to view a list of events that match your search. Hover on an event from the list to view which environments the event appears in, which context kinds sent the latest event, and which SDKs the event is coming from.
- Choose Occurrence as what you want to measure.

- In the Metric definition section, select the following:
- Percentage of [analysis unit] units that sent the event: select the context kind for the metric to measure events from.
- where higher is better or lower is better: select whether the desired outcome is a higher number or a lower number.
- Enter a metric Name.
- (Optional) Add a Description.
- (Optional) Add any Tags.
- (Optional) Update the Maintainer.
- Click Create metric.
You can also use the REST API: Create metric