• Platforms
  • Partners
  • Forums
  • 日本語
  • TLC Tealium Learning Center Tealium Learning
    Community
  • Discussions & Ideas Dicussions & Ideas
  • Product Guides Product Guides
  • Knowledge Base Knowledge Base
  • Developer Docs Developer Docs
  • Education Education
  • TLC Blog TLC Blog
  • Support Desk Support Desk
  • CDH Customer Data Hub Customer Data Hub
  • Mobile
  • Getting Started
    • Overview
    • Quick Start Guide
    • Mobile Concepts
    • Client-Side
    • Server-Side
    • Tracking Webviews
    • Data Layer
    • Consent Management
    • Event Batching
    • User Location and Geofencing
    • Media Tracking
    • Deep Links
    • Timed Events
    • Trace
    • Hosted Data Layer
    • Adobe Visitor Service Module
    • Feature Comparison
    • Troubleshooting
  • Remote Commands
    • Overview
    • How It Works
    • Integrations
      • Adjust
      • AppsFlyer
      • Branch
      • Braze
      • Contentsquare
      • Facebook
      • Firebase
      • Kochava
      • Usabilla
  • Android (Java)
    • Overview
    • Install
    • Track
    • Data Layer
    • Data Management
    • Consent Management
    • Module List
      • Ad Identifier Module
      • Crash Reporter Module
      • Install Referrer Module
      • Lifecycle Tracking Module
      • Location Module
      • Optimizely X Tracking Module
    • Android TV
    • Android Wear
    • API Reference
      • ConsentManager
      • DataSources
      • Lifecycle
      • Tealium
      • Tealium.Config
      • TealiumLocation
    • Release Notes
  • Android (Kotlin)
    • Overview
    • Install
    • Track
    • Data Layer
    • Consent Management
    • Identity Resolution
    • Module List
      • Ad Identifier Module
      • AutoTracking Module
      • AdobeVisitorService Module
      • Collect Module
      • Collectors Module
      • Crash Reporter Module
      • In-App Purchase Module
      • Install Referrer Module
      • Lifecycle Tracking Module
      • Location Manager Module
      • Media Module
      • RemoteCommands Module
      • Tag Management Dispatcher Module
      • Visitor Service Module
    • Android TV
    • API Reference
      • ConsentCategory
      • ConsentManager
      • CurrentVisit
      • DataLayer
      • Lifecycle
      • LocationManager
      • Media
      • Tealium
      • TealiumConfig
      • VisitorProfile
      • VisitorService
    • Release Notes
  • Cordova 1.x
    • Overview
    • Install
    • Track
    • Data Management
    • Module List
      • Ad Identifier Module
      • Crash Reporter Module
      • Install Referrer Module
    • API Reference
    • Release Notes
  • Cordova 2.x
    • Overview
    • Install
    • Track
    • API Reference
    • Release Notes
  • Flutter 1.x
    • Overview
    • Install
    • Track
    • Consent Management
    • Data Management
    • API Reference
    • Release Notes
  • Flutter 2.x
    • Overview
    • Install
    • Track
    • Consent Management
    • Data Management
    • API Reference
      • Tealium
      • TealiumConfig
      • VisitorProfile
    • Release Notes
  • iOS (Objective-C)
    • Overview
    • Install
    • Track
    • Data Layer
    • Data Management
    • Consent Management
    • Tag Management
    • Module List
      • Lifecycle Tracking Module
    • tvOS
    • watchOS
    • API Reference
    • Release Notes
  • iOS (Swift) 1.x
    • Overview
    • Install
    • Track
    • Data Layer
    • Data Management
    • App Extensions
    • Identity Resolution
    • Consent Management
    • Modules
    • Module List
      • AppData Module
      • Attribution Module
      • AutoTracking Module
      • Collect Module
      • Connectivity Module
      • CrashReporter Module
      • DataSource Module
      • DefaultStorage Module
      • Delegate Module
      • DeviceData Module
      • DispatchQueue Module
      • FileStorage Module
      • Lifecycle Module
      • Location Module
      • Logger Module
      • PersistentData Module
      • RemoteCommands Module
      • TagManagement Module
      • VisitorService Module
      • VolatileData Module
    • Feature Comparison
    • Working with Objective-C
    • API Reference
      • TealiumConfig
      • TealiumConsentCategories
      • TealiumConsentManagerDelegate
      • TealiumConsentManager
      • TealiumInstanceManager
      • TealiumPersistentData
      • TealiumVolatileData
      • Tealium
    • Release Notes
  • iOS (Swift) 2.x
    • Overview
    • Install
    • Track
    • Data Layer
    • Consent Management
    • App Extensions
    • Identity Resolution
    • Modules
    • Module List
      • AppData Module
      • AdobeVisitorService Module
      • Attribution Module
      • AutoTracking Module
      • Collect Module
      • Connectivity Module
      • CrashReporter Module
      • DeviceData Module
      • In-App Purchase Module
      • Lifecycle Module
      • Location Module
      • Media Module
      • RemoteCommands Module
      • TagManagement Module
      • VisitorService Module
    • Working with Objective-C
    • API Reference
      • LocationModule
      • MediaSession
      • Tealium
      • TealiumConfig
      • TealiumConsentCategories
      • TealiumConsentManager
      • TealiumDataLayer
      • TealiumInstanceManager
    • Release Notes
  • NativeScript
    • Overview
    • Install
    • Track
    • API Reference
      • Tealium
      • TealiumConfig
    • Release Notes
  • React Native 1.x
    • Overview
    • Install
    • Track
    • API Reference
    • Release Notes
  • React Native 2.x
    • Overview
    • Install
    • Track
    • Location Module
    • API Reference
    • Release Notes
  • Unity 1.x
    • Overview
    • Install
    • Track
    • API Reference
  • Unity 2.x
    • Overview
    • Install
    • Track
    • API Reference
  • Xamarin 1.x
    • Overview
    • Install
    • Track
    • Data Management
    • Consent Management
    • API Reference
    • Release Notes
  • Xamarin 2.x
    • Overview
    • Install
    • Track
    • Data Layer
    • Consent Management
    • API Reference
    • Release Notes
  • Web
  • Getting Started
    • Overview
    • Quick Start Guide
    • Web Concepts
    • Data Layer
      • An Introduction to the Data Layer
      • How the Data Layer Works for Websites
      • Data Layer Best Practices
      • Definitions
        • Retail
        • Publisher
        • Hotel
        • Travel
        • Basic Video Tracking
  • Adobe Launch
    • Overview
    • Install
    • Data Layer
  • AMP
    • Overview
    • Install
    • Track
    • Data Layer
  • Angular
    • Overview
    • Install
    • Track
    • API Reference
  • Google Tag Manager
    • Overview
    • Install
    • Data Layer
  • JavaScript (Web)
    • Overview
    • Install
    • Track
    • Data Layer
    • Universal Data Object (utag_data)
    • Universal Tag (utag.js)
    • Data Layer Object (b)
    • Single-Page Applications
    • Settings
    • Debugging
    • API Reference
      • Cookie Functions
      • GDPR Functions
      • Tracking Functions
      • Utility Functions
    • Release Notes
  • Server
  • C#
    • Overview
    • Install
    • Track
    • Data Layer
    • API Reference
    • Release Notes
  • HTTP API
    • Overview
    • Endpoint
    • Data Layer
  • Java
    • Overview
    • Install
    • Track
    • API Reference
    • Release Notes
  • Node
    • Overview
    • Install
    • Track
    • API Reference
  • Python
    • Overview
    • Install
    • Track
    • API Reference
  • Roku
    • Overview
    • Install
    • Track
    • API Reference
  • Ruby
    • Overview
    • Install
    • Track
    • API Reference
IOS SWIFT V1 IOS SWIFT V1/MODULE LIST

AutoTracking Module

Automatically triggers tracking calls when certain user interface interactions take place. For example, taps, swipes, screen views.

Usage

The AutoTracking module automatically triggers tracking calls when certain user interface interactions take place. For example, taps, swipes, screen views. In general, usage of this module is discouraged and not recommended for the following reasons:

  • Increased memory usage.
  • Increased possibility for crashes to occur due to UI changes outside of Tealium’s control. For example, UI component being deallocated before the track call has completed.
  • Increased battery consumption.
  • Unwanted additional tracking calls.
  • Does not fully remove the need to add additional tracking data/events, so additional coding is still required.

As an alternative to Autotracking, we strongly recommend you spend time carefully planning the tracking and data you need to capture, and have your developers pass this data to Tealium at the appropriate time. Autotracking may be useful if you are evaluating Tealium and need a quick implementation, but it is unlikely to fulfill all your tracking requirements on its own.

The following platforms are supported:

  • iOS
  • tvOS

Features

The AutoTracking module provides the following features:

  • Automatically trigger track calls from UIViewController view appearances.
  • Automatically trigger track calls for UI Events, such as button taps.
  • Includes delegate methods for reporting or suppressing auto-tracked data.
  • Uses method swizzling on UIApplication and UIViewController classes. Disable/exclude if you prefer to avoid swizzling in your app.

Requirements

  • UIKit
  • UIApplication

Install

Install the AutoTracking module with CocoaPods or Carthage.

CocoaPods

To install the AutoTracking module with CocoaPods, add the following pod to your Podfile:

pod 'tealium-swift/TealiumAutotracking'

The framework is auto-instantiated. It has a dependency on the TealiumCore pod. Learn more about CocoaPods installation for iOS.

Carthage

To install the AutoTracking module with Carthage, following these steps:

  1. Go to the app target’s General configuration page in Xcode.

  2. Add the following framework to the Embedded Binaries section:

    TealiumAutotracking.framework
    

The framework is auto-instantiated. It has a dependency on TealiumCore. No additional import statements are necessary. Learn more about Carthage installation for iOS.

Bridging Header

This module has been ported from Objective-C code, and as such, requires a Bridging Header.

To create a bridging header:

  1. In your Swift project, create a new file. When prompted to select a file type, select “Objective-C File.”

  2. Give this file a temporary name, such as placeholder.m, as you are going to remove it later.

  3. Click Finish. Xcode prompts you to create a Bridging Header (if it doesn’t, you probably already have a Bridging Header in your project). Click Create Bridging Header to continue and have Xcode create the new header file for you.

  4. Delete placeholder.m from your project. Notice a new file called ProjectName-Bridging-Header.h.

  5. Add the following import statements to the new Bridging Header:

    #import "uiapplication+tealiumtracker.h"
    #import "uiviewcontroller+tealiumtracker.h"
    

Data Layer

The following variables are transmitted with each tracking call while the module is enabled:

Variable Description Example
autotracked Set to true and added to each auto-tracked tracking call. ["true", "false"]

API Reference

The following methods are available to change the default behavior of the Autotracking module, or to monitor auto-tracked tracking calls:

tealiumAutotrackingShouldTrack()

tealiumAutotrackingShouldTrack(data: [String:Any]) -> Bool
Parameters Type Description Example
data String or [String] Dictionary with String keys and Any value type ["key":"value"]

tealiumAutotrackDidComplete()

tealiumAutotrackDidComplete(success:Bool, info:[String:Any]?, error:Error?)
Parameters Type Description Example
success Bool If the auto-tracked triggered call was successful ["true", "false"]
info String or [String] (Optional) Holds delivery type info, final call format, and the payload (the data dictionary used to generate the call)
error Error Error, if any
"Attribution Module "
Previous
Attribution Module
Next
Collect Module
"Collect Module"

 

Was this article helpful?

This page was last updated: May 17, 2022      

Thank you for your feedback!

Table of Contents

  • Usage
  • Features
  • Requirements
  • Install
    • CocoaPods
    • Carthage
    • Bridging Header
  • Data Layer
  • API Reference
    • tealiumAutotrackingShouldTrack()
    • tealiumAutotrackDidComplete()
  • Platforms
  • Partners
  • Forums
  • Mobile
  • Getting Started
  • Remote Commands
  • Android (Java)
  • Android (Kotlin)
  • Cordova 1.x
  • Cordova 2.x
  • Flutter 1.x
  • Flutter 2.x
  • iOS (Objective-C)
  • iOS (Swift) 1.x
  • iOS (Swift) 2.x
  • NativeScript
  • React Native 1.x
  • React Native 2.x
  • Unity 1.x
  • Unity 2.x
  • Xamarin 1.x
  • Xamarin 2.x
  • Web
  • Getting Started
  • Adobe Launch
  • AMP
  • Angular
  • Google Tag Manager
  • JavaScript (Web)
  • Server
  • C#
  • HTTP API
  • Java
  • Node
  • Python
  • Roku
  • Ruby