duv-by-os report

The following shows how to generate the duv-by-os report using either the Reporting API’s Generate a report POST operation or the Get a cacheable report GET operation. Details about each report’s supported products, metrics, filters, and available data intervals are also available dynamically by running the API’s Get a report type operation, also shown below. See also other available reports.

Report definition

Returns daily unique visitor data by operation system. When querying multiple days worth of data, you’ll receive the MAX daily value across the entire date range for each of the dimensions.

This report yields the top nine values. Remaining values are grouped as a single record titled Other. Use the dataWrapNumberOfItems parameter to control the number of items to report separately, and the dataWrapLabel parameter to identify the remaining group.

Business object: cpcode

Data available for: 92 days

Available metrics

Metric Description
Data metrics
uniqueVisitorsMax The highest number of unique visitors.
uniqueVisitorsPercent Percent of total unique visitors using a particular operating system.

Sample report

POST /reporting-api/v1/reports/duv-by-os/versions/1/report-data{?start,end,dataWrapNumberOfItems,dataWrapLabel}

Sample: /reporting-api/v1/reports/duv-by-os/versions/1/report-data?start=2020-05-01T00%3A00%3A00Z&end=2020-06-01T00%3A00%3A00Z&dataWrapNumberOfItems=2&dataWrapLabel=Other

Object type: Query

Download schema: report-request-schema.json

Query parameters

Parameter Type Sample Description
Required
start String 2020-05-01T00:00:00Z Specifies the start of the reported period as an ISO–8601 timestamp with optional time zone. The report includes data that matches the start value’s timestamp.
end String 2020-06-01T00:00:00Z Specifies the end of the reported period as an ISO–8601 timestamp with optional time zone. The report excludes any data that matches the end value’s timestamp.
Optional
dataWrapNumberOfItems Number 2 Number of top values to be yield in response. Default value: 9. Special values: 0 - will group all values to single record, -1 - will disable outlaying values grouping.
dataWrapLabel String Other Label used as title for grouped record of data which is wrapped. Default value: Other.

JSON request members

Member Type Description
objectIds Array Specifies the set of cpcode values you want to report on.
objectIds Enumeration As an alternative to an array of ID values, specify all as a string for unfiltered data. Either way, objectIds is required.
metrics Array The set of desired metrics. If omitted, the report includes all available metrics.

Request body:

{
    "objectIds": [
        "55232",
        "23433",
        "32433"
    ],
    "metrics": [
        "uniqueVisitorsMax",
        "uniqueVisitorsPercent"
    ]
}

GET /reporting-api/v1/reports/duv-by-os/versions/1/report-data{?start,end,objectIds,allObjectIds,metrics,dataWrapNumberOfItems,dataWrapLabel}

Sample: /reporting-api/v1/reports/duv-by-os/versions/1/report-data?start=2020-05-01T00%3A00%3A00Z&end=2020-06-01T00%3A00%3A00Z&objectIds=55232,23433,32433&metrics=uniqueVisitorsMax%2CuniqueVisitorsPercent&dataWrapNumberOfItems=2&dataWrapLabel=Other

Query parameters

Parameter Type Sample Description
Required
start String 2020-05-01T00:00:00Z Specifies the end of the reported period as an ISO–8601 timestamp with optional time zone. The report excludes any data that matches the end value’s timestamp.
end String 2020-06-01T00:00:00Z Specifies if unavailable reports should be shown.
Optional
allObjectIds Boolean true As an alternative to objectIds, enabling this generates a report that includes all IDs available for the cpcode objectType. This parameter is ignored if the request also specifies a set of objectIds.
objectIds String 55232,23433,32433 As an alternative to allObjectIds, specifies the set of unique IDs for the cpcode objectType you want to report on, formatted as a comma-delimited list.
metrics String uniqueVisitorsMax,uniqueVisitorsPercent Specifies a comma-separated list of metrics to include in the report, otherwise all metrics if omitted. The set of available metrics depends on the type of report. URL-encode the entire value in the GET request.
dataWrapNumberOfItems Number 2 Number of top values to be yield in response. Default value: 9. Special values: 0 - will group all values to single record, -1 - will disable outlaying values grouping.
dataWrapLabel String Other Label used as title for grouped record of data which is wrapped. Default value: Other.

Status 200 application/json

Object type: Report

Download schema: report-response-schema.json

Response body:

{
    "metadata": {
        "name": "duv-by-os",
        "version": "1",
        "outputType": "FLAT",
        "groupBy": [
            "os_version"
        ],
        "start": "2020-05-01T00:00:00Z",
        "end": "2020-06-01T00:00:00Z",
        "availableDataEnds": null,
        "suggestedRetryTime": null,
        "rowCount": 4,
        "filters": [],
        "columns": [
            {
                "name": "groupBy",
                "label": "os_version"
            },
            {
                "name": "uniqueVisitorsMax",
                "label": "Unique Visitors Maximum"
            },
            {
                "name": "uniqueVisitorsPercent",
                "label": "Unique Visitors %"
            }
        ],
        "objectType": "cpcode",
        "objectIds": [
            "55232",
            "23433",
            "32433"
        ]
    },
    "data": [
        {
            "os_version": "Windows 10 (10.0)",
            "uniqueVisitorsMax": "4856",
            "uniqueVisitorsPercent": "64"
        },
        {
            "os_version": "iOS 12 (12.0)",
            "uniqueVisitorsMax": "1038",
            "uniqueVisitorsPercent": "84"
        },
        {
            "os_version": "Other",
            "uniqueVisitorsMax": "3180",
            "uniqueVisitorsPercent": "58"
        }
    ],
    "summaryStatistics": {}
}

Status 200 text/csv

Response Body:

#METADATA_START
name,duv-by-os
version,1
source,duv-by-os/versions/1
groupBy,os_version
start,2020-05-01T00:00:00Z
end,2020-06-01T00:00:00Z
availableDataEnds,
suggestedRetryTime,
rowCount,4
objectType,cpcode
objectIds,55232,23433,32433
#METADATA_END

#SUMMARYSTATISTICS_START

#SUMMARYSTATISTICS_END

#COLUMNS_START
os_version,uniqueVisitorsMax,uniqueVisitorsPercent
#COLUMNS_END

#DATA_START
Windows 10 (10.0),4856,64
iOS 12 (12.0),1038,84
Other,3180,58
#DATA_END

Get report details

This sample Get a report type operation gets the same information you need to run the duv-by-os report as provided in this reference documentation, but available dynamically to your API client application.

GET /reporting-api/v1/reports/duv-by-os/versions/1

Status 200 application/json

Object type: ReportType

Download schema: data-row-schema.json

Response body:

{
    "name": "duv-by-os",
    "description": "Returns daily unique visitor data by operation system. When querying multiple days worth of data, you'll receive the MAX daily value across the entire date range for each of the dimensions.",
    "businessObjectName": "cpcode",
    "version": 1,
    "status": "PUBLISHED",
    "deprecated": false,
    "timeBased": false,
    "outputType": "FLAT",
    "requiredProducts": [
        "Basic Traffic Reports"
    ],
    "requiredRoles": [
        "Reports - All privileges",
        "Reports - View only",
        "OTA App User"
    ],
    "available": true,
    "metrics": [
        {
            "name": "uniqueVisitorsMax",
            "description": "The highest number of unique visitors.",
            "label": "Unique Visitors Maximum",
            "unit": "COUNT",
            "summaryStatistic": false
        },
        {
            "name": "uniqueVisitorsPercent",
            "description": "Percent of total unique visitors using a particular operating system.",
            "label": "Unique Visitors %",
            "unit": "RATIO",
            "summaryStatistic": false
        }
    ],
    "groupOutlyingValues": {
        "enabled": true,
        "groupThreshold": 9,
        "groupName": "Other"
    },
    "groupBy": [
        "os_version"
    ],
    "intervals": [
        "MONTH",
        "WEEK",
        "DAY"
    ],
    "dataRetentionDays": 92,
    "limit": 10000,
    "links": [
        {
            "rel": "self",
            "href": "/reporting-reports-executor-api/v1/reports/duv-by-os/versions/1"
        },
        {
            "rel": "versions",
            "href": "/reporting-reports-executor-api/v1/reports/duv-by-os/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-reports-executor-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-reports-executor-api/v1/reports/duv-by-os/versions/1/report-data"
        }
    ]
}