POST /projects/{project_id}/metrics
Create a Global Metric in a provided Project
Servers
- https://api.optimizely.com/v2
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
project_id |
Integer | Yes |
The Project ID of the Project you want to create a Custom Event in |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
field |
String | No |
The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted Valid values:
|
project_id |
Integer | Yes |
project_id |
archived |
Boolean | No |
Whether the metric is archived Default value: false |
description |
String | No |
description |
event_id |
Integer | Yes |
The ID for the Event to select data from. Omitted for global metrics that are not relative to a specific Event, i.e. "overall revenue" |
scope |
String | Yes |
Specifies how Events should be grouped. Can also be thought of as the denominator of the metric. 'session' divides by the number of sessions. "Influenced sessions", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event Valid values:
Default value: "visitor" |
display_title |
String | No |
display title |
aggregator |
String | Yes |
The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value Valid values:
Default value: "unique" |
display_unit |
String | No |
display unit |
name |
String | Yes |
name |
winning_direction |
String | Yes |
The winning direction of this metric Valid values:
Default value: "increasing" |
event_type |
String | Yes |
The type of this Event Valid values:
|
account_id |
Integer | No |
account_id |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.