Common Fields

The common fields define the core event data structure in RudderStack. These fields also describe the user identity and other vital information about your app or website.

Every RudderStack API call shares the same common fields.

The following table lists all the common fields with their detailed description:

NameData TypePresenceDescription
anonymousIdStringRequiredUnique identification for the user. This is the same as the deviceId.
channelStringRequiredIdentifies the source of the event. Permitted values are mobile, web, server.
contextObjectRequiredContains all the additional user information. The RudderStack SDKs populate this information automatically.
eventStringOptionalCaptures the user action that you want to record.
integrationsObjectOptionalYou can specify the destinations for which you want to enable/disable sending events.
messageIdStringOptionalUnique identification for the event.
propertiesObjectOptionalPasses all the relevant information associated with the event.
originalTimestampTimestampRequiredRecords the actual time when the event occurred.
typeStringRequiredCaptures the type of API. Values can be either track, screen, identify, page.
sentAtTimestampRequiredCaptures the time when the event was sent to RudderStack from the client.

Contextual fields

The contextual fields give additional useful context about a particular event.

The following table lists all the contextual fields with their detailed description:

NameData TypeDescription
appObjectGives detailed information related to your app, like build, name, namespace and version.
deviceObjectInformation about the device from which you are capturing the event. It contains deviceId, manufacturer, model, name and type.
libraryObjectDetails about the RudderStack SDK you are using, like name and version.
localeStringCaptures the language of the device.
ipStringThe user's IP address.
networkObjectContains information about the reachability of the device. Also, it gives you the status of the device's bluetooth, wifi, cellular network and carrier name.
osObjectCaptures the operating system details of the device you are tracking.
screenObjectGives you the screen dimensions of the device, i.e. height, width and the density.
timezoneStringCaptures the timezone of the user you are tracking.
traitsObjectCaptures any additional relevant information about the user. RudderStack fills in the anonymousId for you. You can also associate the traits from the previously-made identify call from the SDK.
userAgentStringThe user agent of the device that you are tracking.
campaignObjectGives detailed information about campaigns, like name, source, medium, content and term.

Not all of the above contextual fields are automatically collected by the RudderStack SDKs. Refer to the following sections for more information on which SDK automatically populates what contextual fields.

The following sections highlight all the contextual fields that are automatically collected and populated by each of the RudderStack SDKs:

JavaScript SDK

FieldAutomatically Collected?
app.name-
app.version-
app.build-
campaign.nameYes
campaign.sourceYes
campaign.mediumYes
campaign.termYes
campaign.contentYes
device.type-
device.advertisingId-
device.adTrackingEnabled-
device.manufacturer-
device.model-
library.nameYes
library.versionYes
ipYes
localeYes
location.latitude-
location.longitude-
location.speed-
network.bluetooth-
network.carrier-
network.cellular-
network.wifi-
os.name-
os.version-
page.pathYes
page.referrerYes
page.searchYes
page.titleYes
page.urlYes
screen.density-
screen.height-
screen.width-
traits-
userAgentYes
timezone-

Android SDK

FieldAutomatically Collected?
app.nameYes
app.versionYes
app.buildYes
campaign.name-
campaign.source-
campaign.medium-
campaign.term-
campaign.content-
device.typeYes
device.idYes
device.advertisingIdYes
device.adTrackingEnabled-
device.manufacturerYes
device.modelYes
device.nameYes
library.nameYes
library.versionYes
ipYes
localeYes
network.bluetoothYes
network.carrierYes
network.cellularYes
network.wifiYes
os.nameYes
os.versionYes
page.path-
page.referrer-
page.search-
page.title-
page.url-
screen.densityYes
screen.heightYes
screen.widthYes
traitsYes
userAgentYes
timezoneYes

iOS SDK

FieldAutomatically Collected?
app.nameYes
app.versionYes
app.buildYes
campaign.name-
campaign.source-
campaign.medium-
campaign.term-
campaign.content-
device.type-
device.idYes
device.advertisingIdYes
device.adTrackingEnabledYes
device.manufacturerYes
device.modelYes
device.name-
library.nameYes
library.versionYes
ipYes
localeYes
network.bluetooth-
network.carrierYes
network.cellularYes
network.wifiYes
os.nameYes
os.versionYes
page.path-
page.referrer-
page.search-
page.title-
page.url-
screen.density-
screen.heightYes
screen.widthYes
traitsYes
userAgent-
timezoneYes

Sample payload with common fields

The following sample payload highlights how the above common and contextual fields are used:

{
"anonymousId": "7e32188a4dab669f",
"channel": "mobile",
"context": {
"app": {
"build": "1",
"name": "RudderAndroidClient",
"namespace": "com.rudderstack.demo.android",
"version": "1.0"
},
"device": {
"id": "7e32188a4dab669f",
"manufacturer": "Google",
"model": "Android SDK built for x86",
"name": "generic_x86",
"type": "android"
},
"library": {
"name": "com.rudderstack.android.sdk.core",
"version": "0.1.4"
},
"locale": "en-US",
"network": {
"carrier": "Android",
"bluetooth": false,
"cellular": true,
"wifi": true
},
"campaign": {
"source": "google",
"medium": "medium",
"term": "keyword",
"content": "some content",
"name": "some campaign"
},
"os": { "name": "Android", "version": "9" },
"screen": { "density": 420, "height": 1794, "width": 1080 },
"timezone": "Asia/Mumbai",
"traits": { "anonymousId": "7e32188a4dab669f" },
"userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)"
},
"event": "Product Reviewed",
"integrations": { "All": true },
"messageId": "1578564113557-af022c68-429e-4af4-b99b-2b9174056383",
"properties": {
"review_id": "review_id_1",
"product_id": "product_id_1",
"rating": 2.0,
"review_body": "Sample Review Body"
},
"originalTimestamp": "2020-01-09T10:01:53.558Z",
"type": "track",
"sentAt": "2020-01-09T10:02:03.257Z"
}

Contact us

For more information on the common fields, feel free to contact us or start a conversation on our Slack channel.