Our exportData API method exports a file where each row is a single JSON object representing a single user session.
Schema
Each row in the export will have a JSON object with the following attributes. Attributes marked as optional below may not be returned (if the value is null).
attribute | type | description |
---|---|---|
isSession | boolean | whether this data is counted towards a session |
appVersion | string optional | the version of the app used on this device (e.g. 2.0.1) |
country | string optional | the country the user is in, specified by ISO 2-letter code (e.g. US for United States) |
timezone | string optional | the timezone abbreviation for the user. See list of timezone abbreviations |
region | string optional | the region (state) the user is in (e.g. ca for California) |
city | string optional | user's current city |
locale | string optional | user's locale, includes language and country set on the device (e.g. "en_US") |
deviceModel | string optional | the model name of the device (e.g. iPad) |
priorEvents | int64 | the number of prior events |
systemName | string optional | the name of the OS the current device is running (e.g. iOS) |
systemVersion | string optional | the version number of the OS the current device is running (e.g. 6.0) |
priorStates | int64 | number of prior states |
time | double | the time the session started in seconds (UTC) |
deviceId | string optional | the device ID for the user's device |
firstRun | double | the time of the user's first session |
sourcePublisherId | string optional | ID of the publisher used to refer the user (e.g. 1001) |
sourcePublisher | string optional | name of the publisher used to refer the user (e.g. Big Fish Games) |
sourceSubPublisher | string optional | name of the developer used to refer the user (e.g. GameDeveloper1) |
sourceSite | string optional | name of the app or website used to refer the user (e.g. MyLittleApp) |
sourceCampaign | string optional | name of the campaign used to refer the user (e.g. US CPI) |
sourceAdGroup | string optional | name of the ad group used to refer the user (e.g. banners) |
sourceAd | string optional | name of the ad used to refer the user (e.g. blue1) |
userId | string | the user ID defined by your app. See more on user IDs in iOS and Android. |
client | string optional | the type of client (e.g. js) |
browserName | string optional | the name of the browser the current device is running (e.g. Chrome) |
browserVersion | string optional | the version number of the browser the current device is running (e.g. 17.0) |
sdkVersion | string | the SDK version running on the user's device |
sessionId | string | the unique session ID for the current session |
lat | double optional | latitude of user's current location |
lon | double optional | the longitude of the user's current location |
duration | double optional | the duration of the current session in seconds (e.g. 19.254) |
priorTimeSpentInApp | double | the total time of previous session(s) in seconds |
timezoneOffsetSeconds | int32 optional | the offset of user's timezone in seconds |
priorSessions | int64 | the number of prior sessions |
userBucket | int32 | the user bucket assigned to this user (0-999) |
isDeveloper | boolean optional | whether the user is a developer and not a user |
experiments | array | see experiments |
states | array | see states |
userAttributes | object | an object with key/value pairs based on the attributes you define. |
Experiments array
Each object within the experiments array follows this schema:
attribute | type | description |
---|---|---|
id | int64 | the ID of the A/B test or message the user is enrolled in |
variantId | int64 | the ID of the variant the user is placed within the test |
impressed | boolean optional | whether the user has seen the test after being assigned to it. |
States array
Each object within the states array follows this schema:
attribute | type | description |
---|---|---|
stateId | integer | the ID for the state |
info | string optional | any info attached to the state |
time | double optional | the time in seconds (UTC) the user reached the state |
duration | double optional | the duration of the state in seconds (UTC) |
name | string optional | the name of the state |
timeUntilFirstForUser | double optional | the time the user spent in the app (in seconds) before reaching the state for the first time. If this is not the first occurrence, this will be null. |
parameters | object | key/value pairs for any parameters you passed (in your code) with the state |
events | array | an array of events triggered while user was in this state |
events[].eventId | int64 | the ID for the event |
events[].value | double | the value passed to the event (within your code) |
events[].info | string optional | any info attached to the event. |
events[].time | double | the time in seconds (UTC) the event occurred |
events[].name | string | the name of the event (defined in your code) |
events[].timeUntiFirstForUser | double optional | the time the user spent in the app (in seconds) before triggering the event for the first time. If this is not the first occurrence, this will be null. |
events[].parameters | object | key/value pairs for any parameters you passed (in your code) with the event |
Example
The following is a single line from an export.
{
"country": "US",
"firstRun": 1499847141.448,
"priorStates": 0,
"city": "toledo",
"experiments": [
{
"id": 4848982474358784,
"variantId": 5318562523119616
}
],
"lon": "83.5552",
"locale": "en_US",
"isSession": false,
"deviceId": "aUsersDeviceId",
"states": [
{
"stateId": -8299958977733658706,
"events": [
{
"eventId": 6467624121712405504,
"timeUntilFirstForUser": 7191.943,
"name": "addToCart",
"time": 1506574496.416,
"value": 0.0,
"parameters": {
"productId": "10248"
}
]
}
],
"duration": 0.0,
"systemName": "Windows",
"browserVersion": "61",
"client": "js",
"browserName": "Chrome",
"lat": "41.66",
"priorSessions": 166,
"userAttributes": {},
"priorEvents": 4652,
"sessionId": "5116700603679946752",
"userId": "[email protected]",
"timezoneOffsetSeconds": 0,
"priorTimeSpentInApp": 316959.844,
"deviceModel": "Web Browser",
"sdkVersion": "1.1.7",
"time": 1506575007.376,
"region": "oh",
"userBucket": 133
}
Note: An actual export will have multiple lines of these JSON-formatted objects, separated by a new line (not a comma). See the example below, but note that I added the ellipses to represent attributes removed. These would never appear in an actual export.
{"country":"SG","firstRun":1.488267623088E9, ... "userBucket":725}
{"country":"ID","firstRun":1.499847141448E9, ... "userBucket":540}
{"country":"US","firstRun":1.984714144849E9, ... "userBucket":430}