Analytics Metrics API
The Analytics 2.0 Metrics API endpoints allow you to retrieve metrics programmatically through Adobe Developer. The endpoints use the same data and methods that are used when working with metrics in the UI. See Metrics in the Analytics Components guide for more information. For information on using the Calculated Metrics API (a separate service), see the Calculated Metrics API endpoint guide.
The endpoints described in this guide are routed through analytics.adobe.io. To use them, you will need to first create a client with access to the Adobe Analytics Reporting API. For more information, refer to Getting started with the Analytics API.
You can find your global company ID by using the Discovery API.
data-variant=info
data-slots=text
This guide includes instructions for using the following endpoints:
- GET multiple metrics: Returns a list of metrics for a given report suite ID
- GET a single metric: Returns a metric corresponding to a supplied ID for a given report suite
GET multiple metrics
Use this endpoint to return a list of metrics for a given report suite ID.
GET https://analytics.adobe.io/api/{GLOBAL_COMPANY_ID}/metrics?rsid={RSID}
Request and response examples
Click the Request tab in the following example to see a cURL request for this endpoint. Click the Response tab to see a successful JSON response for the request.
data-slots=heading, code
data-repeat=2
data-languages=CURL,JSON
Request
curl -X GET "https://analytics.adobe.io/api/{GLOBAL_COMPANY_ID}/metrics?rsid=examplersid&locale=en_US&segmentable=true&expansion=allowedForReporting" \
" \
-H "x-api-key: {CLIENT_ID}" \
-H "Authorization: Bearer {ACCESS_TOKEN}"
Response
[
{
"id": "metrics/campaigninstances",
"title": "Campaign Click-throughs",
"name": "Campaign Click-throughs",
"type": "int",
"category": "Traffic Sources",
"support": [
"oberon",
"dataWarehouse"
],
"allocation": true,
"precision": 0,
"calculated": false,
"segmentable": true,
"supportsDataGovernance": false,
"polarity": "positive",
"allowedForReporting": true,
"standardComponent": true
},
{
"id": "metrics/cartadditions",
"title": "Cart Additions",
"name": "Cart Additions",
"type": "int",
"category": "Conversion",
"support": [
"oberon",
"dataWarehouse"
],
"allocation": true,
"precision": 0,
"calculated": false,
"segmentable": true,
"supportsDataGovernance": true,
"description": "The number of times a visitor added something to their cart. This can help you understand at what part of the conversion funnel that customers show enough interest in a product to add it to their cart.",
"polarity": "positive",
"allowedForReporting": true,
"standardComponent": true
},
]
Request example details
The above example requests the following details:
- The GET metrics list for
examplersidreport suite. - Specifies the response language in
localeas US English with the value asen_US. - To retrieve only
segmentablemetrics. This is specified with the valuetrue. - Information on whether the metric is
allowedForReporting.
Response example details
The above JSON response example shows the following details:
- Information for two metrics in the
examplersidreport suite, includingcampaigninstancesandcartadditions. - Both metrics have the same data
type, set asint. - The metrics differ in
category. ThecategoryforcampaigninstancesisTraffic sources. ThecategoryforcartadditionsisConversion. - The information that both metrics are
segmentableandallowedForReporting, as requested. This is indicated by the valuetruefor each pair.
Request parameters
The GET multiple metrics endpoint includes the following request query parameters:
rsidlocalesegmentablereportableexpansiontags, allowedForReporting, and categoriesResponse parameters
The GET multiple metrics endpoint includes the following response parameters:
idtitlenametypeextraTitleInfocategorysupportallocationprecisioncalculatedpolaritypositive or negativehelplinktagsexpansion request parameter. This can include the tag ID, tag name, tag description, and a list of components associated the tag.allowedForReportingexpansion request parameter. Indicates whether the metric is set to be allowed for reporting.categoriesexpansion request parameter.pathableparentsegmentablereportabledescriptionnoneSettingsGET a single metric
Use this endpoint to retrieve information for a single metric in a report suite.
GET https://analytics.adobe.io/api/{GLOBAL_COMPANY_ID}/metrics/{Metric_ID}?rsid={report suite ID}
Request and response examples
Click the Request tab in the following example to see a cURL request. Click the Response tab to see a successful JSON response for the request.
data-slots=heading, code
data-repeat=2
data-languages=CURL,JSON
Request
curl -X GET "https://analytics.adobe.io/api/{globalCompanyId/metrics/carts?rsid=examplersid&locale=en_US&expansion=categories" \
-H "x-api-key: {CLIENT_ID}" \
-H "Authorization: Bearer {ACCESS_TOKEN}"
Response
{
"id": "metrics/carts",
"title": "Carts",
"name": "Carts",
"type": "int",
"category": "Conversion",
"categories": [],
"support": [
"oberon",
"dataWarehouse"
],
"allocation": true,
"precision": 0,
"calculated": false,
"segmentable": true,
"supportsDataGovernance": true,
"description": "The number of times visitors to the site added items to their online shopping carts.",
"polarity": "positive",
"standardComponent": true
}
Request example details
In the above example, the GET metrics ID request specifies the metric ID as carts and the rsid as examplersid. It includes the query parameters locale as en_US, and the expansion parameter categories as true.
The above example requests the following details:
- The GET metrics ID for
cartsin theexamplersidreport suite. - Specifies the response language in
localeas US English with the value asen_US. - Information on any data associated with
expansionparametercategories.
Response example details
The above JSON response example shows the following details:
- Information for the
cartsmetric in theexamplersidreport suite. - The
typeisint, and thecategoryisConversion. - No
categoriesmetadata is associated with this metric.
For more information on the Metrics API endpoints, see the Adobe Analytics 2.0 API Reference.
Request parameters
The GET a single metric endpoint includes the following request query parameters:
idevar1)rsidlocaleexpansiontags, allowedForReporting, and categoriesResponse parameters
The GET a single metric endpoint includes the same response parameters as the GET multiple metrics response parameters, as described above.