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

/traffic/user/histogram/event

This API produces aggregated histogram over the number of distinct event group items per user represented as two arrays of numbers, 'uniqueUsers' (i.e., the number of users) and 'items' (i.e., the corresponding number of distinct items associated with a user and the particular group). Consequently, if we denote the i-th number in the 'items' array as items(i) and the i-th number in the 'uniqueUsers' array as uniqueUsers(i), then uniqueUsers(i) represents the number of users with the number of distinct items is greater than items(i-1) but smaller than or equal to items(i). Note that, similar to /traffic,' uniqueUsers' is the number of unique Cxense-specific identities, without consideration to the identities linked by the customer. For more information see the user identities demystification page.

The API further allows to define the range of the histogram (that is the minimum and maximum number of items) and the number histogram buckets (i.e., array size). For example, given minimum value 1, maximum value 10, and count 10, the following figure demonstrates a visual interpretation of the results:

items | uniqueUsers | Unknown Attachment 1 | 17009228 2 | 11533 3 | 136 | | | | | | |

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

Filters available

Notes

Last 31 days or less

All except 'adspace'and 'capability'

All

Any

event group

except 'adspace' and 'capability'. Any combination of filters.

More than 31 days ago without

long term storage

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 except 'adspace'and 'capability'

All

Can be used only for a single site, i.e., when the number of sites is 1.

Request

Similar to /traffic/event. However, the 'fields', 'orderBy' and history-related arguments are forbidden and the following additional arguments are supported:

Name

Type

Required

Description

min

Integer

No

The minimum value for the histogram, must be greater than or equal to 1. The default value is 1.

max

Integer

No

The maximum value for the histogram, must be greater than or equal to 'min'. The default value is 1000.

count

Integer

No

The number of histogram buckets, must be between 1 and 1000. The default value is 10.

groups

Array of String

No

The specific groups to aggregate. The list cannot be empty.


  • If 'groups' are not specified, the result is empty. The API performs faster when the number of specified groups is small.

  • This API performs faster when the min-max range is small and the count is low.


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

.

groups

Array of Object

The aggregated groups.

Each group consists of a group name and the corresponding histogram:

Name

Type

Description

group

String

The name of the item.

data

Object

Contains the field names and arrays of aggregated numbers.

Examples

Bash
$ python cx.py /traffic/user/histogram/event '{"siteId":"12345", "groups":["deviceType"], "start":"-1M", "count":10, "min":1, "max":10}'
{
 "start": 1399377949,
 "stop": 1402056349,
 "groups": [
 {
 "data": {
 "items": [
 1,
 2,
 3
 ],
 "uniqueUsers": [
 17009228,
 11533,
 136
 ]
 },
 "group": "deviceType"
 }
 ]
}
Bash
$ python cx.py /traffic/user/histogram/event '{"siteId":"12345", "groups":["url"], "start":"-1w", "count":10, "min":5, "max":20}'
{
 "start": 1401452583,
 "stop": 1402057383,
 "groups": [
 {
 "data": {
 "items": [
 5,
 7,
 8,
 10,
 12,
 13,
 15,
 16,
 18,
 20
 ],
 "uniqueUsers": [
 114811,
 125058,
 35270,
 44974,
 25634,
 8604,
 12254,
 4503,
 6585,
 4815
 ]
 },
 "group": "url"
 }
 ]
}

Last updated: