This API produces an aggregated top-list of items associated with events, called "groups" as parameter. Data associated with the events includes information related to device usage, location, search queries and URL navigation.
The user must be authenticated and have read permissions to the specified sites.
Current aggregation period and filter restrictions are as follows:
|
Period |
Fields available |
Filters available |
Notes |
|---|---|---|---|
|
Last 31 days or less or as specified by long term storage |
All |
All |
|
|
More than 31 days ago without long term storage |
Only |
None |
The number of page views and the number of user sessions initiated in the specified period can be retrieved. |
Top-list items returned for the groups url,referrerUrl or exitLinkUrl are merged by the normalized url, normalized canonical url and/or the [the article id](page://Cxense Content - Review and Refinement). The returned item corresponds to the canonical url (if any was found) or a semi-normalized url.
Request
Identical to /traffic with the following additional fields:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
Array of String |
No |
The specific groups to aggregate. The list cannot be empty. If the Event groups for available groups. |
|
|
Integer |
No |
The maximum number of items to return for each group. The default value is 10, the maximum value is 1000. Note that the data might be distributed across multiple computers, where we retrieve only a number of items from each. The exact number is a multiple of the count parameter. Therefore, if the distribution is very flat (i.e., there are lots of items, but none are significantly more popular than others) the aggregated numbers might be a bit off. Using a larger count may help in this case. |
|
|
String |
No |
The field to be used for item ordering within each group. By default the items are ordered by descending event count, i.e., by popularity. Alternatively, |
Fields
Identical to /traffic. Additional fields partially supported by this method are:
|
Field |
Implicit |
Descriptions |
|---|---|---|
|
|
No |
Resolves the title/description of the aggregated item. |
Event groups
A complete list over all event groups that can be aggregated over can be found here.
Response
The response object has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Integer |
The start time of the aggregation period in seconds, measured in Unix time . |
|
|
Integer |
The stop time of the aggregation period in seconds, measured in Unix time . |
|
|
Object |
The field names and aggregated numbers. |
|
|
Array of Object |
The aggregated groups. |
|
|
Integer |
The start times of the aggregated history buckets. With n buckets, it contains (n + 1) values, where the last value is the stop time of the last bucket. |
Each group consists of a group name and a top list of the aggregated items:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
The name of the group. |
|
|
Array of Object |
The set of items aggregated for this group. See the comment on the count request parameter given above. |
Each item consists of the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
The name of the item. |
|
|
String |
The title/description of the item. The field is set only if it specified by the request and is currently supported only for the |
|
|
Object |
The field names and aggregated numbers. |
|
|
Object |
The field names and lists of aggregated numbers. |
Examples
$ python cx.py /traffic/event '{"siteId":"12345", "groups":["url"], "fields":["uniqueUsers"], "filters":[{"type":"event","group":"referrerHost","item":"google.com"}], "count":1}'
{
"start": 1416299811,
"stop": 1416303411,
"data": {
"events": 4,
"uniqueUsers": 4
},
"groups": [
{
"items": [
{
"item": "https://cxnews.azurewebsites.net",
"data": {
"uniqueUsers": 6,
"events": 6
}
}
],
"group": "url"
}
]
}
$ python cx.py /traffic/event '{"siteId":"12345", "groups":["deviceType"], "fields":["uniqueUsers","activeTime","sessionStarts"], "filters":[{"type":"event","group":"referrerHost","item":"google.com"}]}'
{
"start": 1416299976,
"stop": 1416303576,
"data": {
"events": 178,
"uniqueUsers": 160,
"afterReportEvents": 0,
"activeTime": 0,
"sessionStarts": 159
},
"groups": [
{
"items": [
{
"item": "Mobile",
"data": {
"uniqueUsers": 40,
"events": 40,
"sessionStarts": 35
}
},
{
"item": "Desktop",
"data": {
"uniqueUsers": 18,
"events": 18,
"sessionStarts": 17
}
},
{
"item": "Tablet",
"data": {
"uniqueUsers": 5,
"events": 5,
"sessionStarts": 5
}
}
],
"group": "deviceType"
}
]
}
$ python cx.py /traffic/event '{"siteId":"12345", "groups":["url"], "fields":["events","uniqueUsers"], "orderBy":"uniqueUsers", "count":3}'
{
"start": 1416300138,
"stop": 1416303738,
"data": {
"events": 1156,
"uniqueUsers": 768
},
"groups": [
{
"items": [
{
"item": "https://cxnews.azurewebsites.net",
"data": {
"uniqueUsers": 46,
"events": 46
}
},
{
"item": "https://cxnews.azurewebsites.net/articles/business/stocks-junk-bonds-show-investor-jitters-155514268",
"data": {
"uniqueUsers": 14,
"events": 14
}
},
{
"item": "https://cxnews.azurewebsites.net/articles/business/roche-buy-u-biotech-firm-intermune-8-3-083138154--finance",
"data": {
"uniqueUsers": 11,
"events": 11
}
}
],
"group": "url"
}
]
}
$ python cx.py /traffic/event '{"siteIds":["12345"], "groups":["deviceType"], "start":"2014-11-15T00:00:00.0Z", "historyFields":["events"], "historyResolution":"day"}'
{
"start": 1416009600,
"stop": 1416303922,
"history": [
1668470400,
1668556800,
1668643200,
1668729600,
1668816000,
1668902400,
1668988800,
1669075200,
1669161600,
1669248000,
1669334400,
1669379129
],
"data": {
"events": 233450
},
"groups": [
{
"items": [
{
"item": "Mobile",
"historyData": {
"events": [
8415,
9470,
8868,
4074
]
},
"data": {
"events": 30827
}
},
{
"item": "Desktop",
"historyData": {
"events": [
4181,
4854,
4517,
2000
]
},
"data": {
"events": 15552
}
},
{
"item": "Tablet",
"historyData": {
"events": [
1738,
1911,
1806,
776
]
},
"data": {
"events": 6231
}
}
],
"group": "deviceType"
}
],
"history": [
1416009600,
1416096000,
1416182400,
1416268800,
1416303922
]
}