The AutoTracking module adds automatic tracking of common events to your app, without writing additional code in your app.
How It Works
Add automatic tracking to your app by including the AutoTracking module in your build and initialization. The module has several options to control which screens are tracked and how they are named.
The Autotracking module has two modes of tracking:
Tracks all screen views automatically, with the option to omit screens or override the screen names.
Tracks only the activities that are annotated, with the option to override the screen names.
Use the following annotations to adjust the behavior of the module:
Override event name
Use this annotation to override the default screen name.
@Autotracked(name = "MyCustomName")
private class AnnotatedActivityWithOverride : Activity()
Include in tracking
In partial tracking mode, use this annotation to track specific activities.
private class AnnotatedActivity : Activity()
Omit from tracking
In full tracking mode, use this annotation to omit activities from being tracked automatically.
@Autotracked(track = false)
private class AnnotatedActivityWithoutTracking : Activity()
The full tracking mode uses Application.ActivityLifecycleCallbacks to determine when a new activity comes into focus and then triggers a TealiumView event. In the event, tealium_event is set to the class name, but with “Activity” trimmed from the name.
Use annotations to override the screen name or to prevent activities from being tracked.
The partial tracking mode relies on Annotations to determine which activities to track. Use annotations to specify which activities to track or to override the screen name.
The block list is a JSON file that contains a single array of strings. The strings represent activities to omit from automatic tracking. If a string in the block list appears anywhere in the activity name, it will not be tracked. The string comparisons are case-insensitive.
For example, if you don’t want to track activities that contain the strings “Settings” or “Profile”, then the block list could contain:
The block list file can be stored locally in the assets directory of your app or hosted remotely as a URL.
Use the one of the following TealiumConfig properties to use a block list:
The following variables are included with each tracking call that is triggered by this module:
Set for all events tracked by the Autotracking module.
By default, the automatically tracked events do not include any context variables. To add context data to an event from the AutoTracking module, use the global delegate set in the TealiumConfig to return a map of the custom data object for each tracked activity. This executes for every event tracked by the module.