Create a new metric in the specified project. The expected POST
body differs depending on the specified kind
property.
The project key
A unique key to reference the metric
The kind of event your metric will track
A human-friendly name for the metric
Description of the metric
One or more CSS selectors. Required for click metrics only.
One or more target URLs. Required for click and pageview metrics only.
Whether the metric is active. Set to true
to record click or pageview metrics. Not applicable for custom metrics.
Whether to track numeric changes in value against a baseline (true
) or to track a conversion when an end user takes an action (false
). Required for custom metrics only.
The unit of measure. Applicable for numeric custom metrics only.
The event key to use in your code. Required for custom conversion/binary and custom numeric metrics only.
Success criteria. Required for custom numeric metrics, optional for custom conversion metrics.
An array of randomization units allowed for this metric
The ID of the member who maintains this metric
The method by which multiple unit event values are aggregated
The method for analyzing metric events
The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when analysisType
is percentile
.
Metric response
The ID of this metric
The version ID of the metric
A unique key to reference the metric
A human-friendly name for the metric
The kind of event the metric tracks
The location and content type of related resources
Timestamp of when the metric was created
The number of experiments using this metric
The number of metric groups using this metric
The number of feature flags currently attached to this metric
Details on how to access the metric in the LaunchDarkly UI
Details on the allowed and denied actions for this metric
The ID of the member who maintains this metric
Details on the member who maintains this metric
Description of the metric
The category of the metric
For custom metrics, whether to track numeric changes in value against a baseline (true
) or to track a conversion when an end user takes an action (false
).
For custom metrics, the success criteria
For numeric custom metrics, the unit of measure
For custom metrics, the event key to use in your code
An array of randomization units allowed for this metric
The method by which multiple unit event values are aggregated
The method for analyzing metric events
The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when analysisType
is percentile
.
Experiments that use this metric, including those using a metric group that contains this metric
Metric groups that use this metric
Whether the metric is active
Details on the flags attached to this metric
Version of the metric
For click metrics, the CSS selectors
For click and pageview metrics, the target URLs