Edit in GitHubLog an issue

Example reporting API calls

Use the following examples to help supplement the creation of API calls in your own organization. You can also use the Debugger within Analysis Workspace to view API calls tailored to your organization.

Ranked report example

A basic report that uses a dimension and a metric. This example retrieves the top 5 eVar1 dimension values, sorted by the most page views.

Copied to your clipboard
{
"rsid":"examplersid",
"globalFilters":[
{
"type":"dateRange",
"dateRange":"YYYY-11-30T00:00:00.000/YYYY-12-06T23:59:59.999"
}
],
"metricContainer":{
"metrics":[
{
"columnId":"0",
"id":"metrics/pageviews",
"filters":[
"0"
]
}
],
"metricFilters":[
{
"id":"0",
"type":"dateRange",
"dateRange":"YYYY-10-31T00:00:00.000/YYYY-12-06T23:59:59.999"
}
]
},
"dimension":"variables/evar1",
"settings":{
"dimensionSort":"asc",
"limit":5
}
}

Example trended report

These reports include information about the performance of a metric (or metrics) over a period of time. This example retrieves the number of visits for each day over a week period.

Copied to your clipboard
{
"rsid":"examplersid",
"globalFilters":[
{
"type":"dateRange",
"dateRange":"YYYY-10-31T00:00:00.000/YYYY-11-06T23:59:59.999"
}
],
"metricContainer":{
"metrics":[
{
"columnId":"0",
"id":"metrics/pageviews",
"filters":[
"0"
]
}
],
"metricFilters":[
{
"id":"0",
"type":"dateRange",
"dateRange":"YYYY-10-31T00:00:00.000/YYYY-11-06T23:59:59.999"
}
]
},
"dimension":"variables/daterangeday",
"settings":{
"dimensionSort":"asc"
}
}

Example Anomaly Detection Report

You can use the API to identify anomalies in a metric over a given time period. This type of report is helpful in setting up automated alert tools or dashboards to report the same information as the UI. When using this feature, anomalies are reported for values outside the upper or lower bound of the confidence bands. The building model and confidence bands are pre-defined in Analytics by calculated historical norms.

The response shows an anomaly condition and identifies the following five properties with their corresponding values:

  • data - The actual detected value for the metric (lines 21 and 40)
  • dataExpected - The calculated expected value for the metric (lines 23 and 42)
  • dataUpperBound - The upper limit of the confidence band (lines 26 and 45)
  • dataLowerBound - The lower limit of the confidence band (lines 29 and 48)
  • dataAnomalyDetected - An indicator of whether the metric value is outside of the confidence bands, i.e. True if detected (lines 33-34 and 52-53).
Copied to your clipboard
{
"rsid":"examplersid",
"globalFilters":[
{
"type":"dateRange",
"dateRange":"YYYY-04-16T00:00:00.000/YYYY-04-24T23:59:59.999"
}
],
"metricContainer":{
"metrics":[
{
"columnId":"0",
"id":"metrics/pageviews",
"filters":[
"0"
]
}
],
"metricFilters":[
{
"id":"0",
"type":"dateRange",
"dateRange":"YYYY-04-16T00:00:00.000/YYYY-04-24T23:59:59.999"
}
]
},
"dimension":"variables/daterangeday",
"settings":{
"dimensionSort":"asc",
"includeAnomalyDetection":true
}
}

Media Concurrent Viewers report example

Media concurrent viewers report is a time series report with two specialized metrics.

  • metrics/concurrent_viewers_visitors counts the number of unique visitors.
  • metrics/concurrent_viewers_occurrences counts the number of active sessions.

These metrics can be rolled up to different granularity based on the dimension. For example unique visitors per minute or unique visitors per day etc. These are different dimensions available for media concurrent viewers report.

  • variables/daterangeminute
  • variables/daterangehour
  • variables/daterangeday
  • variables/daterangeweek
  • variables/daterangemonth
  • variables/daterangequarter
  • variables/daterangeyear

The following request example includes both a JSON message request body to request number of unique visitors.

Copied to your clipboard
{
"rsid": "examplersid",
"locale": "en_US",
"dimension": "variables/daterangeminute",
"globalFilters": [
{
"dateRange": "YYYY-08-01T00:00/YYYY-08-01T00:05",
"type": "dateRange"
}
],
"metricContainer": {
"metrics": [
{
"columnId": "column1",
"id": "metrics/concurrent_viewers_visitors"
}
]
},
"settings": {
"dimensionSort": "asc",
"limit": "100",
"page": 0
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.