This API produces a top-list of long-term interests aggregated across profiles of the users who viewed pages. A former version of this is known as "user attention map". This query produces an aggregated result set of User Interests, which are presented in User profiles. This is achieved by summing all interest nodes of all users in the population by considering the individual user interest trees as vectors. Note that an aggregated interest tree based on a population of users will not adhere to the weight balancing principle which is upheld for individual user interest trees, as presented in User profiles. As the sum of the Top node for an individual user is 1, the sum of the Top node for a population of size N will equal N. The sum of the ancestors weights of a node will be equal or less than the weight of the ancestor. The reason for this possible discrepancy is that two individual interest trees may have a common node where this node is expanded to a sub-category for only a subset of the interest trees.
This is illustrated in below (left), where we see the node Top/Tech has two daughters, the sub-categories Computer and Mobile, in the top interest tree, while the node is not expanded in the bottom left tree. When merged (right), we see that the sum of the Top/Tech/Mobile and Top/Tech/Computer does not equal the sum of Top/Tech
Unknown Attachment Unknown Attachment
Conceptually, a discrepancy between the sum of the ancestors and the weight of the parent node could be resolved by injecting a placeholder node which equals the sum of the parent node subtracted by the sum of the ancestors weights, as illustrated below. This would convey the intuition that the node Top/Tech consists of two known sub-categories, Computer and Mobile, while the superfluous weight not belonging to those categories are not defined.
Unknown Attachment
Note that this API does not consider external user identities available to the caller.
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 31 days or less |
All |
|
All |
|
|
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 |
|
All |
The |
Request
Identical to /traffic/event except that history aggregation (historyFields) is not supported and the only fields that can be aggregated are weight, events and uniqueUsers, where both weight and events are implicit and the uniqueUsers field has to be specified explicitly. See also example below.
The aggregated weight for an item is also referred to as its attention score.
Response
Identical to /traffic/event except that each group also has an aggregated summary. See also example below.
Examples
$ python cx.py /traffic/user/interest '{"siteId":"12345", "start":"-7d", "groups":["cxd-categories"], "fields":["uniqueUsers"]}'
{
"start": 1415796187,
"stop": 1416400987,
"groups": [
{
"data": {
"uniqueUsers": 527,
"events": 7516,
"weight": 7516.0
},
"group": "cxd-categories",
"items": [
{
"item": "news",
"data": {
"uniqueUsers": 527,
"events": 7516,
"weight": 2128.711
}
},
{
"item": "careers",
"data": {
"uniqueUsers": 526,
"events": 7514,
"weight": 1629.8281
}
},
{
"item": "sport",
"data": {
"uniqueUsers": 522,
"events": 7502,
"weight": 1376.2344
}
},
{
"item": "careers/jobs",
"data": {
"uniqueUsers": 525,
"events": 7511,
"weight": 1121.7109
}
},
{
"item": "news/business news",
"data": {
"uniqueUsers": 525,
"events": 7511,
"weight": 1094.207
}
},
{
"item": "sport/basketball",
"data": {
"uniqueUsers": 517,
"events": 7468,
"weight": 561.8203
}
},
{
"item": "entertainment",
"data": {
"uniqueUsers": 515,
"events": 7430,
"weight": 509.21875
}
},
{
"item": "travel",
"data": {
"uniqueUsers": 521,
"events": 7476,
"weight": 481.80078
}
},
{
"item": "news/international",
"data": {
"uniqueUsers": 522,
"events": 7498,
"weight": 349.28125
}
},
{
"item": "government",
"data": {
"uniqueUsers": 517,
"events": 7445,
"weight": 335.8164
}
}
]
}
]
}