• 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

TealiumConfig

A class to set configuration options for the main Tealium class. Individual modules provide their own extensions for the TealiumConfig class if they are enabled.

Class: TealiumConfig

The following summarizes the commonly used methods and properties of the iOS (Swift) TealiumConfig class.

Method/Property Description
addDelegate() Adds a new delegate conforming to the TealiumDelegate protocol
addRemoteCommand() Adds remote commands for later execution
batchingBypassKeys Sets a list of event names for which batching is bypassed (sent as individual events)
batchingEnabled Enables or disables (default) event batching
batchSize Sets the amount of events to combine into a single batch request (max: 10)
collectOverrideProfile Overrides the Tealium Collect profile to send data to a different Tealium profile
collectOverrideURL Overrides the Tealium Collect URL to send data to a different endpoint
connectivityRefreshEnabled If enabled (default), the connectivity module checks for a connection at a specified interval
connectivityRefreshInterval Sets the default connectivity refresh interval in seconds
consentLoggingEnabled Enables or disables the consent logging feature
delegates Returns an array of the enabled delegates
dispatchAfter Sets the number of events after which the queue is flushed
dispatchExpiration Sets the batch expiration in days. If the device is offline for an extended period, older events are deleted
dispatchQueueLimit Sets the maximum number of queued events. If this number is reached, and the queue has not been flushed, the oldest events are deleted.
enableRemoteHTTPCommand() Enables the built-in remote HTTP command
existingVisitorId Sets the existing visitor ID, used as the first party ID in the app extension
geofenceFileName Sets the name of a local geofences JSON file asset. Do not include the file extension.
geofenceUrl Sets the URL of a hosted JSON file
initialUserConsentCategories Sets the user’s initial consent categories when the library starts up for the first time
initialUserConsentStatus Sets the initial user consent status
logLevel Sets a new log level
memoryReportingEnabled Enables or disables memory reporting in the DeviceData module
modulesList The list of modules to be enabled or disabled
overrideConsentPolicy Overrides the default consent policy parameter
remoteAPIEnabled Enables (true) or disables (false) remote_api event. Required for RemoteCommands module if DispatchQueue module in use.
remoteCommand Returns an array of all registered remote commands
remoteHTTPCommandDisabled Disables the built-in remote HTTP command if true
rootView Sets the current UIView for WKWebView to be attached to
searchAdsEnabled Enables or disables the Apple Search Ads API in the Attribution module
shouldAddCookieObserver Determines if Tealium should add a WKWebView Cookie Observer
shouldUseRemotePublishSettings Sets the Mobile Publish Settings (default: enabled)
tagManagementOverrideURL Overrides the default URL used by the Tag Management module
TealiumConfig() Constructor for a TealiumConfig object
updateDistance Sets the distance interval (meters) in which the location updates are received
useHighAccuracy Sets the location precision to low accuracy (default) or high accuracy

addDelegate()

Adds a new delegate conforming to the TealiumDelegate protocol.

addDelegate(delegate)
Parameter Type Description
delegate TealiumDelegate A class conforming to the TealiumDelegate protocol

The following example assumes the current module has implemented the TealiumDelegate protocol:

config.addDelegate(self)

addRemoteCommand()

Adds remote commands for later execution.

addRemoteCommand(command)
Parameter Type Description
command TealiumRemoteCommand Instance of a TealiumRemoteCommand to be added

The following example, placed prior to Tealium initialization, shows how add remote commands:

#if os(iOS)
let remoteCommand = TealiumRemoteCommand(commandId: "test",
        description: "test") { response in
			print("Remote Command 'test' executed")
}
config.addRemoteCommand(remoteCommand)
#endif

batchingBypassKeys

Sets a list of event names for which batching is bypassed (sent as individual events).

config.batchingBypassKeys = ["home_screen"]

batchingEnabled

Enables (true) or disables (false) event batching. Disabled by default.

config.batchingEnabled = true

batchSize

Sets the amount of events to combine into a single batch request. Maximum is 10.

config.batchSize = 8

collectOverrideProfile

Overrides the Tealium Collect profile to send data to a different Tealium profile.

config.collectOverrideProfile = "main"

collectOverrideURL

Overrides the Tealium Collect URL to send data to a different endpoint.

config.collectOverrideURL = url
Property value Type Description
url String The URL to override

The default URL is:

https://collect.tealiumiq.com/event/

The default URL with event batching is:

https://collect.tealiumiq.com/bulk-event/

The method is typically used to set a custom hostname, or to set a specific region hostname. The following example sets the Tealium Collect base URL to stay within the EU Central region:

let url = "https://collect-eu-central-1.tealiumiq.com/event/"
config.collectOverrideURL = url

connectivityRefreshEnabled

If enabled (default), the connectivity module checks for a connection at a specified interval (controlled via setConnectivityRefreshInterval). Queued dispatches are then sent as soon as a connection is resumed.

config.connectivityRefreshEnabled = true

connectivityRefreshInterval

Sets the default connectivity refresh interval in seconds. Default is 30 seconds if not set on the TealiumConfig instance.

config.connectivityRefreshInterval = 30

consentLoggingEnabled

Enables the Consent Logging feature, which sends all consent status changes to Tealium Customer Data Hub for auditing purposes.

config.consentLoggingEnabled = true

delegates

Returns an array of the enabled delegates.

The following example shows how to get an array of enabled delegates:

let delegates = config.delegates

dispatchAfter

Number of events after which to automatically flush the queue.

config.dispatchAfter = 20

dispatchExpiration

Sets the dispatch expiration in days. If the device is offline for an extended period. Older events are deleted.

config.dispatchExpiration = 5

dispatchQueueLimit

Sets the maximum number of events to store in the event queue. If this number is reached, and the queue has not been flushed, the oldest events are deleted.

config.dispatchQueueLimit = 50

enableRemoteHTTPCommand()

Enables the built-in remote HTTP command (see Swift Module: RemoteCommands).

enableRemoteHTTPCommand()

existingVisitorId

Sets the existing visitor ID, used as the first party ID in the app extension |

config.existingVisitorId = id

geofenceFileName

Sets the name of a local geofences file asset. Do not include the file extension.

config.geofenceFileName = <String>
Type Description Example
String The JSON file name "geofences"

geofenceUrl

Sets the URL of a hosted geofences file.

config.geofenceUrl = <String (url)>
Type Description Example
String The URL of a geofences file "https://example.com/.../geofences.json"

initialUserConsentCategories

Sets the user’s initial consent categories when the library starts up for the first time. If there are saved preferences, these override any preferences passed in the config object. Sets the consent status to .consented.

config.initialUserConsentCategories = [.cdp, .analytics]

initialUserConsentStatus

Sets the initial user consent status. This happens for the user when the library starts up for the first time. If there are saved preferences, these override any preferences passed in the config object.

Sets the list of consented categories to include ALL available consent categories, if the status is .consented. Does not allow categories to be set selectively.

Use this method to ignore all tracked events prior to consent, overriding the default behavior of queueing events prior to consent being granted. Add the following line to the config object:

config.initialUserConsentStatus = .notConsented
Parameter Type Description Example
status TealiumConsentStatus A value from TealiumConsentStatus enum [.unknown, .consented, .notConsented]

The following define the different types of Tealium consent statuses from the TealiumConsentStatus enum.

.unknown
The unknown status is the default setting for the Consent Manager. In this state, the Consent Manager queues events locally until an affirmative consented/notConsented status is provided.

.consented
The consented status is set when the user has consented to tracking. In this state, the Consent Manager allow all tracking calls to continue as normal.

.notConsented
The notConsented status is set when the user has declined tracking. In this state, the Consent Manager drops all tracking calls and halt further processing by the SDK.

logLevel

Sets a new log level (see Swift Module: Logger).

The following example shows how to set the log level to errors:

let newLogLevel = TealiumLogLevel.errors
config.logLevel = newLogLevel

memoryReportingEnabled

Enables or disables memory reporting in the DeviceData module (default: disabled).

config.memoryReportingEnabled = true

modulesList

Set a net modules list (see Modules List).

The following example shows how to blacklist the autotracking module:

let modulesList = TealiumModulesList(isWhitelist: false, moduleNames: ["autotracking"])
config.modulesList = list

The TealiumModulesList struct has the following parameters:

Parameter Type Description Example
isWhiteList Bool Determines if modules list is a blacklist (false) or a whitelist (true) moduleNames: ["autotracking"]
modulesList [String] Array of module names to enable or disable ["true", "false"]

overrideConsentPolicy

Overrides the default consent policy parameter (default: "gdpr").

let policy = "ccpa"
config.overrideConsentPolicy = policy

remoteAPIEnabled

Enables (true) or disables (false) remote_api event. Required for RemoteCommands module if DispatchQueue module in use. Default false.

config.remoteAPIEnabled = true

remoteCommands

Returns an array of all registered remote commands.

The following example shows how to get an array of all registered remote commands:

let remoteCommands = config.remoteCommands

remoteHTTPCommandDisabled

Disables the built-in remote HTTP command (see Swift Module: RemoteCommands).

config.remoteHTTPCommandDisabled = true

rootView

Sets the current UIView for WKWebView to be attached to. Only required if you have a complex view hierarchy, such as with a push notification, where auto-detection may fail.

let view = self.view
config.rootView = view

searchAdsEnabled

Enables or disables memory reporting in the DeviceData module (default: disabled). |

config.searchAdsEnabled = true

shouldAddCookieObserver

If set to true (default), this method determines if a cookie observer should be added in order to successfully migrate all cookies. If set to false, if multiple cookie observers are present then only one of them is called, which may cause some cookies to not migrate.

config.shouldAddCookieObserver = false

The shouldAddCookieObserver property allows you to use your own cookie observer during cookie synchronization, which requires a cookie observer to retrieve cookies on the main thread after setting them. This issue is caused by bugs in WKWebView, which prevents your own observer from being called.

shouldUseRemotePublishSettings

Sets the Mobile Publish Settings (version 1.9.0+) to enabled (default) or disabled.

config.shouldUseRemotePublishSettings = false

In version 1.9.0+, Mobile Publish Settings are enabled by default, and must be disabled if you don’t wish to use them. Configure the Mobile Publish Settings in iQ Tag Management, or disable it using config.shouldUseRemotePublishSettings = false in the Swift installation. Failure to do causes initialization failures and prevent tracking.

tagManagementOverrideURL

Overrides the default URL used by the Tag Management module. This is needed if you are self-hosting your Tealium JavaScript files.

The following example shows how to override the default URL used by the Tag Management module.

let url = "https://tags.mycdn.com/utag/myaccount/myprofile/myenv/mobile.html"
config.tagManagementOverrideURL =  url

TealiumConfig()

Constructor for a TealiumConfig object. This object is required to initialize the library for your specific account.

TealiumConfig(account:String, profile:String, environment:String, optionalData:Dictionary, dataSource:String)
Parameter Type Description Example
account String Tealium account name "companyXYZ"
profile String Tealium profile name "main"
environment String Tealium environment name ["dev", "qa", "prod"]
datasource String (Optional) Tealium data source key from CDH "abc123"

updateDistance

Sets the distance interval (meters) in which location updates are received.

Only use this method if useHighAccuracy is set to true.

config.updateDistance = <Double>
Type Description Example
Double The distance interval (meters) in which location updates are received 150.0

Usage example:

func start() {
      let config = TealiumConfig(account: "ACCOUNT",
                                 profile: "NAME",
                                 environment: "ENVIRONMENT",
                                 datasource: "DATASOURCE",
                                 optionalData: nil)
      // Tealium Location module config methods
      config.useHighAccuracy = true
      config.updateDistance = 150.0
  }

useHighAccuracy

Sets the location precision to low accuracy (default) or high accuracy.

The property is disabled (false) by default, which sets the location precision to low accuracy. If the location enabled device moves 500 meters or more, then this is considered a significant location changes causing a location update. Location updates typically take longer than five minutes with this setting.

Learn more about Apple’s significant-change location service.

If enabled (true), the property sets the location of data precision to the highest possible accuracy. The initial event is delivered as quickly as possible and then continues to determine the location and delivers additional events, as necessary, when that data is available.

Learn more about Apple’s accuracy of location data.

Using high accuracy results in greater battery consumption for your device than low accuracy, due to more frequent location updates.

config.useHighAccuracy = <Bool>
Type Description Example
Boolean Sets the location data accuracy true

Usage example:

func start() {
      let config = TealiumConfig(account: "ACCOUNT",
                                 profile: "NAME",
                                 environment: "ENVIRONMENT",
                                 datasource: "DATASOURCE",
                                 optionalData: nil)
      // Tealium Location module config methods
      config.useHighAccuracy = true
      config.updateDistance = 150.0
  }
Next
TealiumConsentCategories
"TealiumConsentCategories"

 

Was this article helpful?

This page was last updated: May 17, 2022      

Thank you for your feedback!

Table of Contents

  • Class: TealiumConfig
    • addDelegate()
    • addRemoteCommand()
    • batchingBypassKeys
    • batchingEnabled
    • batchSize
    • collectOverrideProfile
    • collectOverrideURL
    • connectivityRefreshEnabled
    • connectivityRefreshInterval
    • consentLoggingEnabled
    • delegates
    • dispatchAfter
    • dispatchExpiration
    • dispatchQueueLimit
    • enableRemoteHTTPCommand()
    • existingVisitorId
    • geofenceFileName
    • geofenceUrl
    • initialUserConsentCategories
    • initialUserConsentStatus
    • logLevel
    • memoryReportingEnabled
    • modulesList
    • overrideConsentPolicy
    • remoteAPIEnabled
    • remoteCommands
    • remoteHTTPCommandDisabled
    • rootView
    • searchAdsEnabled
    • shouldAddCookieObserver
    • shouldUseRemotePublishSettings
    • tagManagementOverrideURL
    • TealiumConfig()
    • updateDistance
    • useHighAccuracy
  • 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