Skip to main content

Platform and application data tracking

Platform and application data tracking features capture information about the device and the app.

They are enabled by default. But the setting can be changed through TrackerConfiguration like in the example below:

let trackerConfig = TrackerConfiguration()
.platformContext(true)
.applicationContext(true)

Application context

The application context entity contains two properties:

PropertyTypeDescriptionRequired in schema
versionStringVersion number of the application e.g 1.1.0Yes
buildStringBuild name of the application e.g s9f2k2d or 1.1.0 betaYes

Platform context

The platform context entity contains the following properties:

PropertyTypeDescriptionRequired in schema
osTypeStringType of the operating system (e.g., "ios", "tvos", "watchos", "osx", "android")Yes
osVersionStringVersion of the mobile operating system.Yes
deviceManufacturerStringDevice vendor.Yes
deviceModelStringModel of the device.Yes
carrierStringCarrier of the SIM inserted in the device.No
networkTypeStringOne of: "mobile", "wifi", "offline"No
networkTechnologyStringRadio access technology that the device is using.No
openIdfaStringDeprecated property.No
appleIdfaStringAdvertising identifier on iOS.No
appleIdfvStringUUID identifier for vendors on iOS.No
androidIdfaStringAdvertising identifier on Android.No
physicalMemoryIntegerTotal physical system memory in bytesNo
systemAvailableMemoryIntegerAvailable memory on the system in bytes (Android only)No
appAvailableMemoryIntegerAmount of memory in bytes available to the current app (iOS only)No
batteryLevelIntegerRemaining battery level as an integer percentage of total battery capacityNo
batteryStateStringBattery state for the device. One of: "unplugged", "charging", "full".No
lowPowerModeBooleanA Boolean indicating whether Low Power Mode is enabled (iOS only)No
availableStorageIntegerBytes of storage remainingNo
totalStorageIntegerTotal size of storage in bytesNo

Identifier for Advertisers (IDFA/AAID)

The IDFA advertising identifiers are only added to the platform context if you fulfill the following requirements. Otherwise, their values will be NULL.

The Apple advertising identifier is stored in the appleIdfa property.

Starting with iOS 14, one has to request user consent through the App Tracking Transparency framework in order to access the advertising identifier.

  1. Add and follow the guidelines of App Tracking Transparency Framework in your app.
  2. Pass a callback to your TrackerConfiguration that retrieves the identifier:
import AdSupport

let tracker = Snowplow.createTracker(namespace: "ns", network: networkConfig) {
TrackerConfiguration()
.advertisingIdentifierRetriever {
ASIdentifierManager.shared().advertisingIdentifier
}
}
note

The simulators can’t generate a proper IDFA, instead they generate a sequence of zeros. If you want to test IDFA with a real code, please, use the physical device.

The user has the ability to limit ad-tracking from the device’s Settings. If the user enable the limitations the tracker will not be able to track the IDFA.

Was this page helpful?