TrackerConfiguration

open class TrackerConfiguration : TrackerConfigurationInterface, 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

Constructors

Link copied to clipboard
constructor(appId: String)
constructor(appId: String, jsonObject: JSONObject)

This constructor is used in remote configuration.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Identifier of the app. This will be included in every event.

Link copied to clipboard

Whether the application context entity should be sent with all the tracked events.

Link copied to clipboard

It indicates whether the JSON data in the payload should be base64 encoded.

Link copied to clipboard
open override fun copy(): Configuration
Link copied to clipboard

Whether the DeepLink context entity should be sent with the first ScreenView event following a deep link.

Link copied to clipboard

Specify the device platform the tracker is running on.

Link copied to clipboard

Whether to enable diagnostic reporting.

Link copied to clipboard

Whether to enable crash reporting.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Whether to enable automatic tracking of background and foreground transitions. Enabled by default. The androidx.lifecycle-extensions library must be installed.

Link copied to clipboard

It sets the logger delegate that receive logs from the tracker. Default is STDOUT.

Link copied to clipboard

It sets the log level of tracker logs.

Link copied to clipboard

Whether the mobile/platform context entity should be sent with all the tracked events.

Link copied to clipboard

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.

Link copied to clipboard

Set of callbacks to be used to retrieve properties of the platform context. Overrides the tracker implementation for setting the properties.

Link copied to clipboard

Whether the screen context entity should be sent with all the tracked events.

Link copied to clipboard
fun screenEngagementAutotracking(screenEngagementAutotracking: Boolean): TrackerConfiguration

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.

Link copied to clipboard

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.

Link copied to clipboard

Whether the session context entity should be sent with all the tracked events.

Link copied to clipboard

Whether to anonymise client-side user identifiers in session (userId, previousSessionId), subject (userId, networkUserId, domainUserId, ipAddress) and platform context entities (IDFA)

Properties

Link copied to clipboard
open override var appId: String

Identifier of the app.

Link copied to clipboard
open override var applicationContext: Boolean

Whether application context is sent with all the tracked events.

Link copied to clipboard
open override var base64encoding: Boolean

It indicates whether the JSON data in the payload should be base64 encoded.

Link copied to clipboard
open override var deepLinkContext: Boolean

Whether deepLink context is sent with all the ScreenView events.

Link copied to clipboard
open override var devicePlatform: DevicePlatform

It sets the device platform the tracker is running on.

Link copied to clipboard
open override var diagnosticAutotracking: Boolean

Whether enable diagnostic reporting.

Link copied to clipboard
open override var exceptionAutotracking: Boolean

Whether enable crash reporting.

Link copied to clipboard
open override var geoLocationContext: Boolean

Whether geo-location context is sent with all the tracked events.

Link copied to clipboard
open override var installAutotracking: Boolean

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.

Link copied to clipboard
open override var lifecycleAutotracking: Boolean

Whether enable automatic tracking of background and foreground transitions. Enabled by default.

Link copied to clipboard
open override var loggerDelegate: LoggerDelegate?

It sets the logger delegate that receive logs from the tracker.

Link copied to clipboard
open override var logLevel: LogLevel

It sets the log level of tracker logs.

Link copied to clipboard
open override var platformContext: Boolean

Whether mobile/platform context is sent with all the tracked events.

Link copied to clipboard

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.

Link copied to clipboard

Set of callbacks to be used to retrieve properties of the platform context. Overrides the tracker implementation for setting the properties.

Link copied to clipboard
open override var screenContext: Boolean

Whether screen context is sent with all the tracked events.

Link copied to clipboard

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.

Link copied to clipboard
open override var screenViewAutotracking: Boolean

Whether enable automatic tracking of ScreenView events.

Link copied to clipboard
open override var sessionContext: Boolean

Whether session context is sent with all the tracked events.

Link copied to clipboard

Fallback configuration to read from in case requested values are not present in this configuration.

Link copied to clipboard
open override var trackerVersionSuffix: String?

Decorate the v_tracker field in the tracker protocol.

Link copied to clipboard
open override var userAnonymisation: Boolean

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