Validate calculated metrics
Because report suites can have different configurations, dimensions, or metrics, a calculated metric that is valid in one report suite may not be valid in another. To determine which calculated metric to use in different report suites, and why it may or may not be available, you can use the /validate
endpoint. This endpoint allows you to POST
a definition along with a target report suite id. The validate endpoint responds with compatibility information on the calculated metric.
POST https://analytics.adobe.io/api/{COMPANY_ID}/calculatedmetrics/validate
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.
Example validate request
The following example shows a request to validate a target report suite id for a given calculated metric definition:
Copied to your clipboardcurl -X POST "http://analytics.adobe.io/api/exampleco/calculatedmetrics/validate?locale=en_US" \-H "x-api-key: {CLIENTID}" \-H "Authorization: Bearer {ACCESSTOKEN}" \-d '{"rsid": "[report suite id]","definition": {"formula": {"func": "subtract","col2": {"func": "metric","name": "metrics/reloads"},"col1": {"func": "metric","name": "metrics/occurrences"}},"func": "calc-metric","version": [1,0,0]}}'
Copied to your clipboard{"valid": true,"identityMetrics": [ { "identity": "metrics/occurrences" }, { "identity": "metrics/reloads" } ],"functions": [ "subtract" ],"validator_version": "1.0.0","supported_products": [ "oberon", "frag" ],"supported_schema": [ "schema_oberon", "schema_frag" ]}