The AutoTracking module adds automatic tracking of screen views to your app with only a minimal amount of additional code.
The following platforms are supported:
How It Works
Add the AutoTracking module to your build and initialization to take advantage of automatic screen view tracking. The module has several options to control which screens are tracked and how they are named.
The AutoTracking module supports two modes of tracking:
UIKit - Tracks all screen views automatically, with the option to omit screens using the block list.
SWiftUI - Not supported.
UIKit - For each view to track, create a subclass of the view controller.
SwiftUI - For each view to track, either create a view modifier or embed the view in the Tealium tracking container.
Full tracking is only available in a UIKit app.
In UIKit, the AutoTracking module uses method swizzling on the viewDidAppear instance method of ViewController. The name of the tracked event is set to the UIViewController.title property or, if that’s not available, is set to the UIViewController class name after removing the “ViewController” suffix.
Use partial tracking for more control over automatic tracking and to optimize performance. This approach uses annotations in your ViewController code to only track the views you need. This approach is not dependent on any particular app design paradigm and it works with a UIKit app or a SwiftUI app.
Use the block list feature in the full tracking mode to suppress specific tracking calls.
The block list is a JSON file that contains a single array of strings. The strings represent views to omit from automatic tracking. If a string in the block list appears anywhere in the view controller name, it will not be tracked. The string comparisons are case-insensitive.
For example, if you don’t want to track any view controller names that contain the strings “Settings” or “Profile”, then the block list could contain:
The block list file can be stored locally in your app or hosted remotely as a URL.
Use the one of the following TealiumConfig properties to use a block list: