Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev guideRecipesAPI ReferenceChangelog
Dev guideAPI ReferenceUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
API Reference
GitHubDev CommunityOptimizely AcademySubmit a ticket

Optimizely developer documentation

How can we help you?

Try our conversational search powered by Generative AI!

AI OnAI Off

Create a Metric

Create a new Metric

Log in to see full request history
Body Params
date-time

The date and time the entity was last modified.

int64

The unique identifier for the event which this metric measures.

string
required

A value specifying the method used to aggregate the numerator of the metric value.

string

Specifies the numeric attribute to be aggregated when using the "sum" aggregator.

string

The unique identifier for the metric.

int64
required

The unique identifier for the account which contains the metric.

int64

The unique identifier for the project which contains the metric. Used when the metric's visibility is "project."

string
length between 0 and 200

A human-friendly name for the metric.

string
length between 0 and 1000

A textual description of the metric.

string

A value specifying the action a visitor takes to trigger the event which the metric measures.

string
required

Specifies whether the customer considers a value higher or lower than the baseline as a positive outcome for the metric.

string | null

A value specifying where all filter conditions or any single filter condition must be met for a conversion to be included in the metric calculation.

string
required

A value specifying the contexts in which the metric may be used. Account-visible metrics may be used by any experiment within any project in the account. Project-level metrics may be used by any experiment in the same project which contains the metric. Experiment-level metrics can only be used in the experiment they are associated with.

boolean

When true, indicates the metric is no longer in use and is not available for new experiments.

string

A hash value that serves as a method to determine whether two metrics are the same.

boolean
Defaults to false

When true, indicates that the metric should be evaluated based on the occurrence of the event.

int64

The total number of experiments, campaigns, and feature rules that currently use the metric.

event_properties
array of objects
event_properties
metrics
array of objects
length between 0 and 2
metrics
Responses

Language
URL
Click Try It! to start a request and see the response here! Or choose an example:
application/json