This API produces aggregated top-lists of keywords found in the content profiles of the viewed pages, also known as "attention map". For each top-list item, the only fields that can be aggregated by this API are weight, events and (in most cases) urls. The other fields, however, can be aggregated by combining /traffic request with a filter based on the particular item.
The user must be authenticated and have read permissions to the given sites.
Current aggregation period and filter restrictions are as follows:
|
Period |
Groups available |
Fields available |
Filters available |
Notes |
|---|---|---|---|---|
|
Last 24 hours or less |
All |
|
All |
Any combination of fields and filters is supported. However, when the |
|
Last 31 days or less |
All |
|
All |
Any combination of fields except the |
|
More than 31 days ago without long term storage |
None |
None |
None |
The data is unavailable for periods over 31 days, unless the sites are configured with long term support. |
|
More than 31 days ago with long term storage |
All |
weight, events |
All |
The |
Request
Identical to /traffic/event except that the only fields that can be aggregated are weight (also known as attention score), events and urls, where both weight and events are implicit and the urls field has to be specified explicitly. See also example below.
Response
Identical to /traffic/event except that each group also has an aggregated summary. See also example below.
Examples
$ python cx.py /traffic/keyword '{"siteId":"12345", "groups":["person"], "fields":["urls"], "count":3}'
{
"start": 1416304027,
"stop": 1416307627,
"groups": [
{
"data": {
"weight": 279.79688,
"events": 197,
"urls": 42
},
"group": "person",
"items": [
{
"item": "robin williams",
"data": {
"weight": 36.23047,
"events": 38,
"urls": 8
}
},
{
"item": "lauren bacall",
"data": {
"weight": 16.347656,
"events": 18,
"urls": 4
}
},
{
"item": "jordan strauss",
"data": {
"weight": 11.234375,
"events": 12,
"urls": 2
}
}
]
}
]
}
$ python cx.py /traffic/keyword '{"siteId":"12345", "groups":["pageclass"], "historyFields":["events"], "start":"-5m", "historyResolution":"minute"}'
{
"start": 1416307505,
"stop": 1416307805,
"groups": [
{
"data": {
"events": 48,
"weight": 48.0
},
"historyData": {
"events": [
8,
12,
10,
10,
8
]
},
"group": "pageclass",
"items": [
{
"item": "article",
"historyData": {
"events": [
8,
12,
10,
10,
8
]
},
"data": {
"events": 48,
"weight": 48.0
}
}
]
}
],
"history": [
1416307505,
1416307565,
1416307625,
1416307685,
1416307745,
1416307805
]
}