Tracker Configuration
The TrackerConfiguration can be used to set up the tracker behaviour, including what should be tracked in term of automatic tracking, and entities to track with the events. Tracker logging can also be configured here.
Default values:
devicePlatform: DevicePlatform.Mobile
base64encoding: true
logLevel: LogLevel.OFF
loggerDelegate: null
sessionContext: true
applicationContext: true
platformContext: true
geoLocationContext: false
screenContext: true
deepLinkContext: true
screenViewAutotracking: true
screenEngagementAutotracking: true
lifecycleAutotracking: true
installAutotracking: true
exceptionAutotracking: true
diagnosticAutotracking: false
userAnonymisation: false
Functions
Identifier of the app. This will be included in every event.
Whether the application context entity should be sent with all the tracked events.
It indicates whether the JSON data in the payload should be base64 encoded.
Whether the DeepLink context entity should be sent with the first ScreenView event following a deep link.
Specify the device platform the tracker is running on.
Whether to enable diagnostic reporting.
Whether to enable crash reporting.
Whether the geo-location context entity should be sent with all the tracked events. The location is based off the last cached location in the device. Requires Location permissions as per the requirements of the various Android versions. Otherwise no entity is added at all.
Whether to enable automatic tracking of install event. In case com.android.installreferrer:installreferrer library is present, an entity with the referrer details will be attached to the install event.
Whether to enable automatic tracking of background and foreground transitions. Enabled by default. The androidx.lifecycle-extensions library must be installed.
It sets the logger delegate that receive logs from the tracker. Default is STDOUT.
It sets the log level of tracker logs.
Whether the mobile/platform context entity should be sent with all the tracked events.
List of properties of the platform context to track. If not passed and platformContext
is enabled, all available properties will be tracked. The required osType
, osVersion
, deviceManufacturer
, and deviceModel
properties will be tracked in the entity regardless of this setting.
Set of callbacks to be used to retrieve properties of the platform context. Overrides the tracker implementation for setting the properties.
Whether the screen context entity should be sent with all the tracked events.
Whether to enable tracking the screen end event and the screen summary context entity. Make sure that you have lifecycle autotracking enabled for screen summary to have complete information.
Whether to enable automatic tracking of ScreenView events. Note that this automatic tracking relies on the Android Application.ActivityLifecycleCallbacks
interface, and therefore only works with Activity-based apps. Composable screens or views in Jetpack Compose apps are not autotracked.
Whether the session context entity should be sent with all the tracked events.
Whether to anonymise client-side user identifiers in session (userId, previousSessionId), subject (userId, networkUserId, domainUserId, ipAddress) and platform context entities (IDFA)
Properties
Whether application context is sent with all the tracked events.
It indicates whether the JSON data in the payload should be base64 encoded.
Whether deepLink context is sent with all the ScreenView events.
It sets the device platform the tracker is running on.
Whether enable diagnostic reporting.
Whether enable crash reporting.
Whether geo-location context is sent with all the tracked events.
Whether to enable automatic tracking of install event. In case com.android.installreferrer:installreferrer library is present, an entity with the referrer details will be attached to the install event.
Whether enable automatic tracking of background and foreground transitions. Enabled by default.
It sets the logger delegate that receive logs from the tracker.
Whether mobile/platform context is sent with all the tracked events.
List of properties of the platform context to track. If not passed and platformContext
is enabled, all available properties will be tracked. The required osType
, osVersion
, deviceManufacturer
, and deviceModel
properties will be tracked in the entity regardless of this setting.
Set of callbacks to be used to retrieve properties of the platform context. Overrides the tracker implementation for setting the properties.
Whether screen context is sent with all the tracked events.
Whether to enable tracking the screen end event and the screen summary context entity. Make sure that you have lifecycle autotracking enabled for screen summary to have complete information.
Whether enable automatic tracking of ScreenView events.
Whether session context is sent with all the tracked events.
Fallback configuration to read from in case requested values are not present in this configuration.
Decorate the v_tracker field in the tracker protocol.
Whether to anonymise client-side user identifiers in session (userId, previousSessionId), subject (userId, networkUserId, domainUserId, ipAddress) and platform context entities (IDFA) Setting this property on a running tracker instance starts a new session (if sessions are tracked).