Link Search Menu Expand Document

In Snapyr, every API call has some common fields to support timestamping, user identity, etc.

In more detail, the common fields for every API call are:

Field Type Description
anonymousId optional if userID is set instead String A unique substitute for a User ID if not set explicitly. A userId or an anonymousId is required with every call.
context optional Object Dictionary of extra information that provides useful context about a message, but is not directly related to the API. See below for more details.
messageId implicit String Automatically collected; a unique identifier for each message.
receivedAt implicit Date Automatically set by Snapyr, the timestamp of when a message is received by Snapyr in ISO-8601 date format.
sentAt optional Date Timestamp of when a message is sent by Snapyr, set automatically by the SDK. Sent as ISO-8601 date format.
timestamp optional Date Timestamp when the message itself took place, defaulted to the current time by the Snapyr SDK as a ISO-8601 date format.
type implicit String Type of message, corresponding to the API method: 'identify', 'track', 'screen' etc.
userId optional if anonymousID is set instead String Unique identifier for the user in your database. A userId or an anonymousId is required.
version implicit Number Version of the Tracking API that received the message, automatically set by Snapyr.

Context

Context provides additional info about the user or device, sent as part of every call. Context is a complete and explicit specification, so properties outside the spec are ignored. The fields are as follows:

Field Type Description
active Boolean Whether a user is active
app Object Dictionary of information about the current application, containing name, version and build. Collected automatically via the mobile SDKs.
device Object Dictionary of information about the device, containing id, advertisingId, manufacturer, model, name, type and version.
ip String Current user’s IP address.
library Object Dictionary of information about the library making the requests to the API, containing name and version.
locale String Locale string for the current user, for example en-US.
location Object Dictionary of information about the user’s current location, containing city, country, latitude, longitude, region and speed.
network Object Dictionary of information about the current network connection, containing bluetooth, carrier, cellular and wifi
os Object Dictionary of information about the operating system, containing name and version
page Object Dictionary of information about the current page in the browser, containing path, referrer, search, title and url. Mainly used in the web / JavaScript SDK.
screen Object Dictionary of information about the device’s screen, containing density, height and width
timezone String Timezones are sent as tzdata strings. For example America/New_York
traits Object Dictionary of traits for the current user
userAgent String User agent of the device making the request

What Is Tracked In Each Environment

The below indicates which context items are tracked automatically in each environment. Note that Unity will track different fields depending on whether the final build is deployed on iOS or Android.

CONTEXT FIELD Web iOS Android
app.name
app.version
app.build
campaign.name
campaign.source
campaign.medium
campaign.term
campaign.content
device.type
device.id
device.advertisingId
device.adTrackingEnabled
device.manufacturer
device.model
device.name
library.name
library.version
ip
locale
location.latitude
location.longitude
location.speed
network.bluetooth
network.carrier
network.cellular
network.wifi
os.name
os.version
page.path
page.referrer
page.search
page.title
page.url
screen.density
screen.height
screen.width
traits
userAgent
timezone