Edit in GitHubLog an issue

Calculated metrics

The Calculated metrics APIs allow you to retrieve, update, or create calculated metrics programmatically through Adobe Developer. The APIs use the same data and methods that are used when working with calculated metrics in the UI. See Calculated metrics overview in the CJA documentation for more information.

You can call the /calculatedmetrics/ endpoint to add, edit or delete calculated metrics.

Retrieve a list of calculated metrics

In CJA, you can navigate to Components > Calculated metrics and see a list of calculated metrics that you created or others have shared. This call is helpful to identify the ID's of desired calculated metrics.

GET https://cja.adobe.io/calculatedmetrics

For example, get a response of all calculated metrics shared with the user.

Copied to your clipboard
curl -X GET "https://cja.adobe.io/calculatedmetrics?includeType=shared" \
-H "x-api-key: {CLIENTID}" \
-H "x-gw-ims-org-id: {IMSORG}" \
-H "Authorization: Bearer {ACCESSTOKEN}"

Find components that use a specified calculated metric

To retrieve a list of components that contain a specified calculated metric, include the usedIn expansion parameter in your metrics request.

The following example shows a list components that include the conversion rate, as provided for the value for the usedIn expansion parametr. Note that the details for components 4444 and 5555 are returned:

Copied to your clipboard
{
"content": [
{
"name": "conversion rate",
"description": "Example channel segment",
"organization": "77717@ExampleOrg",
"recentRecordedAccess": "YYYY-06-05T13:40:31Z",
"performanceScore": "2.14",
"id": "s44444444@ExampleOrg_44444444",
"usedIn": [
{
"componentId": "4444",
"componentType": "project",
"subType": "project",
"internal": false,
"name": "Example Customer Analysis",
"lastRecordedAccess": 7777775200236
},
{
"componentId": "5555",
"componentType": "project",
"subType": "project",
"internal": false,
"name": "Example Traffic",
"lastRecordedAccess": 7777776824296
},
],
"usageSummary": {
"count": 0,
"mostRecentTimestamp": null,
"itemId": null
},
"owner": {
"imsUserId": "7777777777.e",
"ownerId": "777777777@7777777777.e",
"name": null,
"type": "imsUser"
},
"dataId": null
}
],
"totalElements": 2,
"totalPages": 1,
"numberOfElements": 1,
"number": 0,
"firstPage": true,
"lastPage": true,
"sort": null,
}

Retrieve a single calculated metric

Once you have the desired ID, you can append the ID to the call to retrieve details on a single calculated metric:

GET https://cja.adobe.io/calculatedmetrics/{id}

For example, get details around the calculated metric with an ID of a5066209:

Copied to your clipboard
curl -X GET "https://cja.adobe.io/calculatedmetrics/a5066209" \
-H "x-api-key: {CLIENTID}" \
-H "x-gw-ims-org-id: {IMSORG}" \
-H "Authorization: Bearer {ACCESSTOKEN}"

Create a calculated metric

Create a calculated metric with the desired definition for use in reporting.

POST https://cja.adobe.io/calculatedmetrics

For example, create a basic calculated metric that divides visits by visitors:

Copied to your clipboard
{
"name": "Integration Test 1",
"description": "Integration Test 1 Description",
"dataId": "{DATAID}",
"type": "percent",
"definition": {
"func": "calc-metric",
"formula": {
"func": "divide",
"col1": {
"func": "metric",
"name": "metrics\/visits"
},
"col2": {
"func": "metric",
"name": "metrics\/visitors"
}
},
"version": [
1,
0,
0
]
}
}

API status codes

For a description of API status codes and tips for troubleshooting, see the Platform FAQ and troubleshooting guide.

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.