exportData schema (JSON)

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).

attributetypedescription
isSessionbooleanwhether this data is counted towards a session
appVersionstring
optional
the version of the app used on this device (e.g. 2.0.1)
countrystring
optional
the country the user is in, specified by ISO 2-letter code (e.g. US for United States)
timezonestring
optional
the timezone abbreviation for the user. See list of timezone abbreviations
regionstring
optional
the region (state) the user is in (e.g. ca for California)
citystring
optional
user's current city
localestring
optional
user's locale, includes language and country set on the device (e.g. "en_US")
deviceModelstring
optional
the model name of the device (e.g. iPad)
priorEventsint64the number of prior events
systemNamestring
optional
the name of the OS the current device is running (e.g. iOS)
systemVersionstring
optional
the version number of the OS the current device is running (e.g. 6.0)
priorStatesint64number of prior states
timedoublethe time the session started in seconds (UTC)
deviceIdstring
optional
the device ID for the user's device
firstRundoublethe time of the user's first session
sourcePublisherIdstring
optional
ID of the publisher used to refer the user (e.g. 1001)
sourcePublisherstring
optional
name of the publisher used to refer the user (e.g. Big Fish Games)
sourceSubPublisherstring
optional
name of the developer used to refer the user (e.g. GameDeveloper1)
sourceSitestring
optional
name of the app or website used to refer the user (e.g. MyLittleApp)
sourceCampaignstring
optional
name of the campaign used to refer the user (e.g. US CPI)
sourceAdGroupstring
optional
name of the ad group used to refer the user (e.g. banners)
sourceAdstring
optional
name of the ad used to refer the user (e.g. blue1)
userIdstringthe user ID defined by your app. See more on user IDs in iOS and Android.
clientstring
optional
the type of client (e.g. js)
browserNamestring
optional
the name of the browser the current device is running (e.g. Chrome)
browserVersionstring
optional
the version number of the browser the current device is running (e.g. 17.0)
sdkVersionstringthe SDK version running on the user's device
sessionIdstringthe unique session ID for the current session
latdouble
optional
latitude of user's current location
londouble
optional
the longitude of the user's current location
durationdouble
optional
the duration of the current session in seconds (e.g. 19.254)
priorTimeSpentInAppdoublethe total time of previous session(s) in seconds
timezoneOffsetSecondsint32
optional
the offset of user's timezone in seconds
priorSessionsint64the number of prior sessions
userBucketint32the user bucket assigned to this user (0-999)
isDeveloperboolean
optional
whether the user is a developer and not a user
experimentsarraysee experiments
statesarraysee states
userAttributesobjectan object with key/value pairs based on the attributes you define.

Experiments array

Each object within the experiments array follows this schema:

attributetypedescription
idint64the ID of the A/B test or message the user is enrolled in
variantIdint64the ID of the variant the user is placed within the test
impressedboolean
optional
whether the user has seen the test after being assigned to it.

States array

Each object within the states array follows this schema:

attributetypedescription
stateIdintegerthe ID for the state
infostring
optional
any info attached to the state
timedouble
optional
the time in seconds (UTC) the user reached the state
durationdouble
optional
the duration of the state in seconds (UTC)
namestring
optional
the name of the state
timeUntilFirstForUserdouble
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.
parametersobjectkey/value pairs for any parameters you passed (in your code) with the state
eventsarrayan array of events triggered while user was in this state
events[].eventIdint64the ID for the event
events[].valuedoublethe value passed to the event (within your code)
events[].infostring
optional
any info attached to the event.
events[].timedoublethe time in seconds (UTC) the event occurred
events[].namestringthe name of the event (defined in your code)
events[].timeUntiFirstForUserdouble
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[].parametersobjectkey/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}