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

/dmp/traffic/data

This API allows to export DMP event data.

The user must be authenticated and have read permissions to site group/site.

Count limit and pagination

  • By default the API is limited to exporting maximum 1 000 000 events in one request. If the period specified by start and stop contains too many events, the API will respond with an error suggesting to reduce the interval of interest.

  • Alternatively, it is possible to paginate the events by specifying count. In this case, the response will contain up to the specified number of events, and a paginationStop if there are more events to retrieve. The returned paginationStop can then be included in the next request as a paginationStart allowing to paginate without any bi-effect on the specified filters, such as explodeUsers. When using pagination, set start and stop of subsequent requests to the start/stop value returned by the first request. Note that time filters using relative offsets (such as segments) may affect the result. If count is too low (i.e., there are more than 1000 events per second), the response will contain an empty set of events and a paginationStop. This indicates that the API user must either increase the count or stop the execution to avoid an infinite loop. For examples, see [/traffic/data](page:///traffic/data).

Request

The request object has the following fields:

Name

Type

Required

Description

siteIds

Array of String

No

The set of sites to aggregate over.

siteId

String

No

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

siteGroupIds

Array of String

No

The set of site groups 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.

start

Integer or String

No

The start time of the period of interest specified according to

Traffic time specification

. The default value is one hour ago.

stop

Integer or String

No

The stop time of the period of interest specified according to

Traffic time specification

. The default value is right now.

filters

Array of Object

No

Traffic filters

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

fields

Array of String

No

The event fields to export. The available field names can be found below or via /dmp/traffic/data/describe. Only the time field is returned by default, any other fields must be specified explicitly.

externalUserIdTypes

Array of String

No

The external user identifier types to return. Must be specified whenever externalUserIds field is requested. Use /dmp/traffic/data/describe to list available identity types. Only the found, specified types will be included in the response.

origins

Array of String

No

The specific origins to filter and aggregate over. If not specified for these requests, all available/permitted origins are used.

origin

String

No

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

count

Integer

No

The pagination count. When specified, instead of failing on too many events, the response will contain up to the specified count of events and a paginationStop (to be used as the paginationStart for the next request). The count must be between 1 000 and 1 000 000 inclusive.

paginationStart

Integer or String

No

The time of the first event to be included in the result. The field can only be used in combination with count and by default takes the value of start.

The available fields are given below.

Name

Description

Example response value

time

The time of event, measured in

Unix time

.

1416295321

userId

The cross-site user identifier which can be used to differentiate devices/browsers, lookup user profiles (e.g.,

/profile/user

), or filtering by the

user id

. For the latter purpose, the corresponding filter will be: {"type":"user", "group":"cx", "item":"cx:24e3e2b04:ksfrvi"}

cx:24e3e2b04:ksfrvi

userCorrelationId

The alternative cross-site identifier. The returned identifier can be used to differentiate devices/browsers,but not for user profile lookups or filtering. This field is deprecated and it is recommended to use userId instead.

6bfffa9c4e0daabe

externalUserIds

The requested and known external user identities associated with the user.The identity types must be specified in the request via externalUserIdTypes.

[{"type": "cxd", "id": "CRM91595539"}]

eventId

The identifier used to differentiate distinct DMP events from the same user.

499292181

pageViewEventId

The identifier used to differentiate distinct page view events from the same user.

921814992

site

The site identifier.

12345

origin

The origin of event.

"cxd-shop"

type

The type of event.

"addToCart"

segments

The matching segments that have been reported.

["120213123","312021312"]

customParameters

The list of custom parameters.

[{"group": "product", "item": "615"},{"group": "category", "item": "Digital Camera"}]

Response

The response object has the following fields:

Name

Type

Description

start

Integer

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

Unix time

.

stop

Integer

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

Unix time

.

events

Array of Object

The list of events where each event consists of specified field names and the corresponding values.

paginationStart

Integer

The pagination start time if any was specified. The value represents seconds measured in

Unix time

.

paginationStop

Integer

The pagination stop time if count was specified and the period of interest contains more events after the last returned event. The value represents seconds measured in

Unix time

.

Examples

Bash
$ python cx.py /dmp/traffic/data '{"start":"-1m", "siteId":"12345", "origin":"cxd-shop", "fields":["userId","externalUserIds","eventId","pageViewEventId","type","customParameters"], "externalUserIdTypes":["cxd"]}'
{
 "start": 1443005094,
 "stop": 1443005694,
 "events": [
 {
 "time": 1443005573,
 "userId": "cx:24e3e2b04:ksfrvi",
 "eventId": 499292181,
 "pageViewEventId": 921814992,
 "externalUserIds": [
 {
 "type": "cxd",
 "id": "CRM91595539"
 }
 ],
 "customParameters": [
 {
 "group": "product",
 "item": "615"
 },
 {
 "group": "category",
 "item": "Digital Camera"
 }
 ],
 "type": "addToCart"
 }
 ]
}

Last updated: