Result grouping

The KPI service gives you grouping options to enable you to format your data how you want. You can pass several grouping options in each call.

The KPI service groups results based on the order in which you pass grouping options. If you pass the following, the KPI service groups results by tracker and nests results for each country.

grouping=trackers,countries

If you pass the following, the KPI service groups results by country and nests results for each tracker.

grouping=countries,trackers

Tracker grouping options

Grouping optionDescription
appsGroups results by app token and app name.
trackersGroups results by network trackers. This grouping doesn't affect calls that include a tracker_token in the URL path.
networksGroups results by network.
  • All networks if no tracker_token is specified in the URL path.
  • Networks associated with the tracker_token if it is specified in the URL path.
campaignsGroups results by network campaigns.
  • All campaigns if no tracker_token is specified in the URL path.
  • Campaigns associated with the tracker_token if it is specified in the URL path.
adgroupsGroups results by ad groups.
  • All ad groups if no tracker_token is specified in the URL path.
  • Ad groups associated with the tracker_token if it is specified in the URL path.
creativesGroups results by creatives.
  • All creatives if no tracker_token is specified in the URL path.
  • Creatives associated with the tracker_token if it is specified in the URL path.

Time period grouping options

Tip:
When grouping by weeks or months, make sure your date range includes whole weeks or months. If your selection starts in the middle of a week or month, this group will be incomplete.
Grouping optionDescription
hourGroups results by hour. All periods included in the result set are returned as date fields in an array of dates.
dayGroups results by day. All periods included in the result set are returned as date fields in an array of dates.
weekGroups results by week. All periods included in the result set are returned as date fields in an array of dates.
monthGroups results by month. All periods included in the result set are returned as date fields in an array of dates.

Other grouping options

Grouping optionDescription
countriesGroups results by country in the ISO 3166 Alpha-2 code format. All countries included in the result set are returned as country fields in an array of countries.
regionGroups results by region. All device types included in the result set are returned as region fields in an array of regions.
device_typesGroups results by device type. All device types included in the result set are returned as device_type fields in an array of device_types.
os_namesGroups results by OS name. All device types included in the result set are returned as os_name fields in an array of os_names.
partnersGroups results by partner. All device types included in the result set are returned as partner fields in an array of partners.