We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

/traffic/table

This API allows to compare aggregated data across multiple filters. The API is somewhat similar to /traffic/compare, and the main difference is that this API allows to compare up to 100 defined populations instead of two, but aggregates only one group at a time and does not support historyFields. A typical use case for this API is to create a table or a heat map such as the one that can be found under Comparison/Dimensions in the Insight UI.

The user must be authenticated and have read permissions to the specified sites.

The time, field and filter selection restrictions are the same as for each particular type. See for example /traffic/event, /traffic/keyword or /traffic/custom.

Request

The request object has the following fields:

Name

Type

Required

Description

start

Integer or String

No

The start time of the aggregation period specified according to

Traffic time specification

. The default value is one hour ago.

stop

Integer or String

No

The stop time of the aggregation period specified according to

Traffic time specification

. The default value is right now.

siteId

String

No

The site to aggregate over. A more convenient alternative to siteIds, in the case of just one site.

siteIds

Array of String

No

The set of sites to aggregate over.

siteGroupId

String

No

The site group to aggregate over. A more convenient alternative to siteGroupIds, in the case of just one site group.

siteGroupIds

Array of String

No

The set of site groups to aggregate over.

filters

Array of Object

No

Traffic filters

) to be applied for all data. Conjunctive semantics (and) are assumed for the top-level filters.

columnFilters

Array of Object

No

The filters to be applied for each result column. Filter syntax is documented

here

. For multiple predicates in each column AND must be declared explicitly. The maximum number of columns is 20.

type

String

Yes

The type of data, if not specified the data to be returned includes only the summary. The supported types are:'traffic', 'event', 'custom', 'keyword', 'user-keyword', 'user-external', 'intent', 'dmp', 'dmp-event', 'dmp-custom'.

groups

Array of String

No

The group names for the specified data type, must be specified for types other than 'traffic' and 'dmp'. Use describe of the specified type (e.g.,

/traffic/event/describe

for event) to list the available groups. Only one group can be specified per call, array is used to keep the API consistent with the other APIs.

count

Integer

No

The maximum number of items (rows). The default value is 10, the maximum value is 100.

fields

Array of String

No

The metrics to aggregate. The available field names are listed

here

. See the API corresponding to the specified type (e.g.,

/traffic/keyword

for keyword) for a list of supported fields.

Alternatively to 'columnFilters', columns can be specified using 'columnType', 'columnGroup' and 'columnCount':

Name

Type

Required

Description

columnType

String

Yes

The type of data, if not specified the data to be returned includes only the summary. The supported types are: 'traffic', 'event', 'custom', 'keyword', 'user-keyword', 'user-external', 'intent', 'dmp', 'dmp-event', 'dmp-custom'.

columnGroup

String

Yes

The group name for the specified data type, must be specified for types other than 'traffic' and 'dmp'. Use describe of the particular type, for example

/traffic/event/describe

, to list available groups.

columnCount

Integer

No

The maximum number of items (rows). The default value is 10, the maximum value is 100.

The latter approach is equivalent to finding top items for the given type, group and count and creating column filters using these. For practical reasons, the response in this case includes the names and when requested/possible titles of the extracted top-items.

Response

The response object has the following fields:

Name

Type

Description

start

Integer

The start time of the aggregation period in seconds, measured in

Unix time

.

stop

Integer

The stop time of the aggregation period in seconds, measured in

Unix time

.

columnItems

Array of Object

Returned when the columns are specified using 'columnType', 'columnGroup' and 'columnCount'. The inner object contains two fields:item– item corresponding to this column;title – title of the given item.

data

Object

Contains the data summary aggregated according to 'filter'.

columnData

Object

Contains the data aggregated according to 'columnFilters'. For each field the result contains an array of numbers where the i-th number corresponds to the i-th column.

groups

Array of Object

Contains the data summary for each group aggregated according to 'filter'.

The groups array is either empty or contains a single group object with following fields:

Name

Type

Description

group

String

The name of the group.

data

Object

Returned only for the keyword-based types. Contains the group summary aggregated according to 'filter'.

columnData

Object

Returned only for the keyword-based types. Contains the group summary aggregated according to 'columnFilters'. For each field the result contains an array of numbers where the i-th number corresponds to the i-th column.

items

Array of Object

The top-items according to 'filter'.

Each item object contains three fields:

Name

Type

Description

item

String

The name of the item.

data

Object

Contains the data aggregated according to 'filters'.

columnData

Object

Contains the data aggregated according to 'columnFilters'. For each field the result contains an array of numbers where the i-th number corresponds to the i-th column.

Examples

Bash
$ cx.py /traffic/table '{"siteId":"9222302702321341959", "start":"-1d", "type":"event", "groups":["resolution"], "columnType":"event", "columnGroup":"deviceType"}'
{
 "columnItems": [
 {
 "item": "Mobile"
 },
 {
 "item": "Desktop"
 },
 {
 "item": "Tablet"
 }
 ],
 "stop": 1433772892,
 "start": 1433686492,
 "columnData": {
 "events": [
 17295,
 6268,
 3121
 ]
 },
 "groups": [
 {
 "items": [
 {
 "columnData": {
 "events": [
 2223,
 773,
 395
 ]
 },
 "item": "1280x768",
 "data": {
 "events": 3391
 }
 },
 {
 "columnData": {
 "events": [
 2215,
 767,
 396
 ]
 },
 "item": "1280x1024",
 "data": {
 "events": 3378
 }
 },
 {
 "columnData": {
 "events": [
 2188,
 788,
 389
 ]
 },
 "item": "1920x1200",
 "data": {
 "events": 3365
 }
 },
 {
 "columnData": {
 "events": [
 2110,
 821,
 403
 ]
 },
 "item": "1024x768",
 "data": {
 "events": 3334
 }
 },
 {
 "columnData": {
 "events": [
 2121,
 794,
 401
 ]
 },
 "item": "2560x1080",
 "data": {
 "events": 3316
 }
 },
 {
 "columnData": {
 "events": [
 2156,
 779,
 367
 ]
 },
 "item": "2560x1600",
 "data": {
 "events": 3302
 }
 },
 {
 "columnData": {
 "events": [
 2170,
 761,
 371
 ]
 },
 "item": "800x600",
 "data": {
 "events": 3302
 }
 },
 {
 "columnData": {
 "events": [
 2111,
 765,
 399
 ]
 },
 "item": "480x640",
 "data": {
 "events": 3276
 }
 },
 {
 "columnData": {
 "events": [
 0,
 18,
 0
 ]
 },
 "item": "2560x1440",
 "data": {
 "events": 18
 }
 },
 {
 "columnData": {
 "events": [
 0,
 2,
 0
 ]
 },
 "item": "1920x1080",
 "data": {
 "events": 2
 }
 }
 ],
 "group": "resolution"
 }
 ],
 "data": {
 "events": 26684
 }
}

Last updated: