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
startandstopcontains 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 apaginationStopif there are more events to retrieve.The returnedpaginationStopcan then be included in the next request as apaginationStartallowing to paginate without any bi-effect on the specified filters, such asexplodeUsers. 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 apaginationStop. 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 |
|---|---|---|---|
|
|
Array of String |
No |
The set of sites to aggregate over. |
|
|
String |
No |
The site to aggregate over. A more convenient alternative to |
|
|
Array of String |
No |
The set of site groups to aggregate over. |
|
|
String |
No |
The site group to aggregate over. A more convenient alternative to |
|
|
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. |
|
|
Integer or String |
No |
The stop time of the period of interest specified according to Traffic time specification . The default value is right now. |
|
|
Array of Object |
No |
Traffic filters to be applied. Conjunctive semantics ( |
|
|
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 t |
|
|
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. |
|
|
Array of String |
No |
The specific origins to filter and aggregate over. If not specified for these requests, all available/permitted origins are used. |
|
|
String |
No |
The origin to aggregate over. A more convenient alternative to |
|
|
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 |
|
|
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 |
The available fields are given below.
|
Name |
Description |
Example response value |
|---|---|---|
|
|
The time of event, measured in Unix time . |
|
|
|
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: |
|
|
|
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. |
|
|
|
The requested and known external user identities associated with the user.The identity types must be specified in the request via |
|
|
|
The identifier used to differentiate distinct DMP events from the same user. |
|
|
|
The identifier used to differentiate distinct page view events from the same user. |
|
|
|
The site identifier. |
|
|
|
The origin of event. |
|
|
|
The type of event. |
|
|
|
The matching segments that have been reported. |
|
|
|
The list of custom parameters. |
|
Response
The response object has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Integer |
The start time of the period of intertest in seconds, measured in Unix time . |
|
|
Integer |
The stop time of the period of interest in seconds, measured in Unix time . |
|
|
Array of Object |
The list of events where each event consists of specified field names and the corresponding values. |
|
|
Integer |
The pagination start time if any was specified. The value represents seconds measured in Unix time . |
|
|
Integer |
The pagination stop time if Unix time . |
Examples
$ 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"
}
]
}