Edit in GitHubLog an issue

Validate calculated metrics

Data views have different dimensions and metrics available. A calculated metric that's valid in one data view might not be valid in another. You can use the calculatedmetrics/validate endpoint to check and see if a given calculated metric is valid.

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

An example POST body:

Copied to your clipboard
1{
2 "name": "Integration Test 1",
3 "description": "Integration Test 1 Description",
4 "dataId": "{DATAID}",
5 "type": "percent",
6 "definition": {
7 "func": "calc-metric",
8 "formula": {
9 "func": "divide",
10 "col1": {
11 "func": "metric",
12 "name": "metrics\/visits"
13 },
14 "col2": {
15 "func": "metric",
16 "name": "metrics\/visitors"
17 }
18 },
19 "version": [
20 1,
21 0,
22 0
23 ]
24 }
25}

An example response:

Copied to your clipboard
1{
2 "valid": true,
3 "identityMetrics": [ { "identity": "metrics/visits" }, { "identity": "metrics/visitors" } ],
4 "functions": [ "divide" ],
5 "validator_version": "1.0.0",
6 "supported_products": [ "oberon", "frag" ],
7 "supported_schema": [ "schema_oberon", "schema_frag" ]
8}
Copyright © 2021 Adobe. All rights reserved.