• 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

Table of Contents

  • Install
    • CocoaPods
    • Manual
  • Track
    • Automatic Tracking
    • Manual Tracking
  • Data Layer
IOS OBJECTIVE C/MODULE LIST

Lifecycle Tracking Module

Provides app lifecycle tracking events to an existing 5.x implementation of Tealium for iOS.

Install

The Lifecycle Tracking module must be added to your app. Install the module with CocoaPods or manually similar to the Tealium for iOS library.

In any abstraction class (like TealiumHelper.h) replace any @import TealiumIOS with @import TealiumIOSLifecycle.

CocoaPods

To install the Lifecycle Tracking module with CocoaPods, add the following to your Podfile:

pod 'TealiumIOSLifecycle'

Manual

To install the Lifecycle Tracking module manually, following these steps:

  1. Download the Lifecycle Tracking module.

  2. Add the TealiumIOSLifecycle.framework file to your project (in the Embedded Binaries section).

Track

The module tracks the following lifecycle events:

Lifecycle Event Description
launch App is launched
sleep App sent to background
wake App sent to foreground
none For data added to events but not associated with a lifecycle event

These values are indicated in the lifecycle_type variable.

Automatic Tracking

Configure the Lifecycle Tracking module to automatically listen for the standard UIApplication notifications to automatically trigger launch, wake and sleep events.

Unlink or remove the TealiumIOSLifecycle.framework from your project to remove lifecycle tracking.

Launch Event
Generated on detection of UIApplicationDidFinishLaunchingNotification.

Sleep Event
Generated on detection of UIApplicationWillResignActiveNotification.

Wake Event
Generated on detection of UIApplicationWillEnterForegroundNotification.

Manual Tracking

Available for specific lifecycle paradigms and non-conventional lifecycle tracking. In order to manually track lifecycle events, disable lifecycle auto-tracking by setting setLifecycleAutotrackingIsEnabled to NO.

Launch Event
To manually track a launch event, call:

[[Tealium instanceForKey:@"(uniqueInstanceId)"] launch];

Sleep Event
To manually track a sleep event, call:

[[Tealium instanceForKey:@"(uniqueInstanceId)"] sleep];

Wake Event
To manually track a wake event, call:

[[Tealium instanceForKey:@"(uniqueInstanceId)"] wake];

Data Layer

The Lifecycle Tracking module adds the following data layer variables:

Variable Type Description Example Event
lifecycle_ dayofweek_local Number Local day of week that call was made, such as 1=Sunday, 2=Monday 2 all
lifecycle_ dayssincelaunch Number Days since first launch in integer increments 23 all
lifecycle_ dayssinceupdate Number Days since the last detected app version update in integer increments 46 all
lifecycle_ dayssincelastwake Number Days since last detected wake in integer increments 1 all
lifecycle_ diddetectcrash Boolean Crash inferred from missing prior sleep event (only present if a launch event follows a wake event) [true, false] launch
lifecycle_ firstlaunchdate String GMT timestamp of the first detected launch/wake in ISO8601 format from Zulu time "2013-07-11T17:55:04Z"  all 
lifecycle_ firstlaunchdate_ MMDDYYYY  String GMT Timestamp formatted as MM/DD/YYYY  "01/17/2012"  all
lifecycle_ hourofday_local String Local hour of day that call was made (24 hour format)  "12"  all
lifecycle_ isfirstlaunch Boolean Only present if call is the first launch call [true, false] launch
lifecycle_ isfirstlaunchupdate Boolean Only present if call is first launch after a detected updated [true, false] launch
lifecycle_ isfirstwakemonth Boolean Only present if call is first launch/wake of the month [true, false] launch, wake 
lifecycle_ isfirstwaketoday Boolean Only present if call is first launch/wake of the day  [true, false] launch, wake
lifecycle_ launchcount Number Total number of launches this version of your app (since the last update) 3  all
lifecycle_ secondsawake Number Whole seconds app was awake since last wake/launch (sent only with lifecycle_type:sleep or lifecycle_type:terminate calls) 30 all 
lifecycle_ priorsecondsawake  Number Whole seconds app was awake since last launch only - aggregates total from all wakes prior (sent only with lifecycle_type:launch calls)  126  all
lifecycle_ sleepcount Number Total number of times your app has gone to sleep (resets if updated) 5   all
lifecycle_ totalcrashcount Number Total number of crashes counted since install (only reset if app deleted)  21   all
lifecycle_ totallaunchcount Number Total number of launches since install (only reset if app deleted)  3   all
lifecycle_ totalsecondsawake Number Total number of seconds your app has been in a woken/active state since app install (only reset if app deleted)  36  all
lifecycle_ totalsleepcount Number Total number of times your app has gone into the background since app install (only reset if app deleted)  "400"  all
lifecycle_ totalwakecount Number Total number of launches + wakes since install (only reset if app deleted)  563  all
lifecycle_type String Type of lifecycle call ["launch", "wake", "sleep"]  all
lifecycle_ updatelaunchdate String GMT timestamp of first wake/launch after a version update has been detected "2014-09-08T18:10:01Z"  all
lifecycle_ wakecount Number Total number of launches + wakes in this version of your app (resets if updated)  29  all

 
  • 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
    • Deep Links
    • Timed Events
    • Trace
    • Hosted Data Layer
    • Feature Comparison
    • Troubleshooting
  • Remote Commands
    • Overview
    • How It Works
    • Integrations
      • AppsFlyer
      • 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
      • Collect Module
      • Collectors Module
      • Crash Reporter Module
      • Install Referrer Module
      • Lifecycle Tracking Module
      • Location Manager Module
      • RemoteCommands Module
      • Tag Management Dispatcher Module
      • Visitor Service Module
    • Android TV
    • API Reference
      • ConsentCategory
      • ConsentManager
      • CurrentVisit
      • DataLayer
      • Lifecycle
      • LocationManager
      • Tealium
      • TealiumConfig
      • VisitorProfile
      • VisitorService
    • Release Notes
  • Cordova
    • Overview
    • Install
    • Track
    • Data Management
    • Module List
      • Ad Identifier Module
      • Crash Reporter Module
      • Install Referrer Module
    • API Reference
    • Release Notes
  • Flutter
    • Overview
    • Install
    • Track
    • Consent Management
    • Data Management
    • API Reference
    • 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
      • Attribution Module
      • AutoTracking Module
      • Collect Module
      • Connectivity Module
      • CrashReporter Module
      • DeviceData Module
      • Lifecycle Module
      • Location Module
      • RemoteCommands Module
      • TagManagement Module
      • VisitorService Module
    • Working with Objective-C
    • API Reference
      • 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
    • API Reference
    • Release Notes
  • Unity
    • Overview
    • Install
    • Track
    • API Reference
  • Xamarin
    • Overview
    • Install
    • Track
    • Data Management
    • 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

Was this article helpful?

This page was last updated: November 22, 2019       Thank you for your feedback!
  • Platforms
  • Partners
  • Forums
  • Mobile
  • Getting Started
  • Remote Commands
  • Android (Java)
  • Android (Kotlin)
  • Cordova
  • Flutter
  • iOS (Objective-C)
  • iOS (Swift) 1.x
  • iOS (Swift) 2.x
  • NativeScript
  • React Native 1.x
  • React Native 2.x
  • Unity
  • Xamarin
  • Web
  • Getting Started
  • Adobe Launch
  • AMP
  • Angular
  • Google Tag Manager
  • JavaScript (Web)
  • Server
  • C#
  • HTTP API
  • Java
  • Node
  • Python
  • Roku
  • Ruby