Calculated metric functions
Calculated Metrics are comprised of several different mathematical functions that work on available metrics for a given report suite.
Adobe may add optional request and response members (name/value pairs) to existing API objects at any time and without notice or changes in versioning. Adobe recommends that you refer to the API documentation of any third-party tool you integrate with our APIs so that such additions are ignored in processing if not understood. If implemented properly, such additions are non-breaking changes for your implementation. Adobe will not remove parameters or add required parameters without first providing standard notification through release notes.
Get all functions
Returns a full list of calculated metric functions that the user can access.
GET https://analytics.adobe.io/api/{GLOBALCOMPANYID}/calculatedmetrics/functions/
Copied to your clipboardcurl -X GET "https://analytics.adobe.io/api/exampleco/calculatedmetrics/functions" \-H "x-api-key: {CLIENTID}" \-H "Authorization: Bearer {ACCESS_TOKEN}"
Copied to your clipboard[{"id": "col-sum","category": "basic","persistable": true,"name": "Column Sum","description": "Adds all of the numeric values for a metric within a column (across the elements of a dimension).","definition": {"func": "calc-metric","parameters": [{"func": "parameter-def","name": "col","type": "column","friendlyName": "metric","description": "Requires at least one metric but can take any number of metrics as parameters."}],"version": [1,0,0]}},{...}]
Get a single function
Returns details around a single calculated metric function if you specify the id
. You can obtain the desired id
by calling the multiple calculated metrics endpoint.
GET https://analytics.adobe.io/api/{GLOBALCOMPANYID}/calculatedmetrics/functions/{ID}
For example, the following request returns information around the add
calculated metric function:
Copied to your clipboardcurl -X GET "https://analytics.adobe.io/api/exampleco/calculatedmetrics/functions/add" \-H "x-api-key: {CLIENTID}" \-H "Authorization: Bearer {ACCESS_TOKEN}"
Copied to your clipboard{"id": "add","category": "internal","persistable": true,"definition": {"func": "calc-metric","parameters": [{"func": "parameter-def","name": "col1","type": "column","friendlyNameKey": "metric_X","descKey": "FirstMetricToAdd"},{"func": "parameter-def","name": "col2","type": "column","friendlyNameKey": "metric_Y","descKey": "SecondMetricToAdd"}],"version": [1,0,0]}}