TealiumConfig

public struct TealiumConfig

The object used to configure a Tealium instance with constant values and dependencies.

  • The Tealium account

    Declaration

    Swift

    public let account: String
  • The Tealium profile for the given account

    Declaration

    Swift

    public let profile: String
  • The environment, typically prod/qa/dev

    Declaration

    Swift

    public let environment: String
  • The datasource for the data coming from this SDK

    Declaration

    Swift

    public let dataSource: String?
  • key

    A key used to uniquely identify Tealium instances.

    Declaration

    Swift

    public var key: String { get }
  • The file name from which to read the Local JSON settings. These settings will be deep merged with Remote and Programmatic settings, which will take priority over Local settings.

    Declaration

    Swift

    public internal(set) var settingsFile: String? { get }
  • The URL from which to download Remote settings. These settings will be deep merged with Local and Programmatic settings. Programmatic settings will take priority over Remote settings, Remote settings will take priority over Local settings.

    Declaration

    Swift

    public internal(set) var settingsUrl: String? { get }
  • A list of unique ModuleFactorys, each one for creating a specific Module.

    Declaration

    Swift

    public internal(set) var modules: [any ModuleFactory] { get }
  • A list of unique BarrierFactorys, each one for creating a specific ConfigurableBarrier

    Declaration

    Swift

    public internal(set) var barriers: [any BarrierFactory] { get }
  • A type of logger that can handle logs of different level

    Declaration

    Swift

    public var loggerType: TealiumLoggerType
  • The specific bundle in which to look for objects like the Local settings.

    Declaration

    Swift

    public var bundle: Bundle
  • A visitor ID to be used instead of our anonymous visitor ID.

    Declaration

    Swift

    public var existingVisitorId: String?
  • An adapter that can convert CMP specific data to a ConsentDecision that the Tealium consent integration system can handle.

    Declaration

    Swift

    public var cmpAdapter: CMPAdapter?
  • Creates a new Tealium configuration.

    Declaration

    Swift

    public init(account: String,
                profile: String,
                environment: String,
                dataSource: String? = nil,
                modules: [any ModuleFactory] = [],
                settingsFile: String? = nil,
                settingsUrl: String? = nil,
                forcingSettings block: ((_ builder: CoreSettingsBuilder) -> CoreSettingsBuilder)? = nil)

    Parameters

    account

    The Tealium account identifier.

    profile

    The Tealium profile identifier.

    environment

    The environment (dev, qa, prod).

    dataSource

    Optional data source identifier.

    modules

    Array of module factories to initialize.

    settingsFile

    Optional local settings file name.

    settingsUrl

    Optional remote settings URL.

    block

    Optional block for forcing core settings.

  • Adds a ModuleFactory to the list of modules that need to be instantiated by the SDK.

    You can add a ModuleFactory for a specific Module only once. Adding two of them will result in all but the first to be discarded. Some specific ModuleFactory, like Modules.collect() can potentially instantiate more than one Collect module, if they are provided with multiple settings and different Module IDs, but the factory still only needs to be added once.

    Declaration

    Swift

    public mutating func addModule<SpecificFactory>(_ module: SpecificFactory) where SpecificFactory : ModuleFactory

    Parameters

    module

    The unique ModuleFactory used to create a specific type of Module.

  • Sets a load rule to be used by any of the modules by the rule’s key.

    Declaration

    Swift

    public mutating func setLoadRule(_ rule: Rule<Condition>, forId loadRuleId: String)

    Parameters

    rule

    The Rule<Condition> that defines when that rule should match a payload.

    loadRuleId

    The id used to look up this specific rule when defining it in the ModuleSettings

  • Sets a transformation to be used by a specific transformer.

    The transformation ID and transformer ID will be combined and need to be unique or the newer transformation will replace older ones.

    Declaration

    Swift

    public mutating func setTransformation(_ transformation: TransformationSettings)

    Parameters

    transformation

    The TransformationSettings that defines which Transformer should handle this transformation and how.

  • Adds a BarrierFactory that will create a ConfigurableBarrier to control the flow of dispatches to the Dispatchers.

    Declaration

    Swift

    public mutating func addBarrier(_ barrier: any BarrierFactory)

    Parameters

    barrier

    The BarrierFactory that can create a specific ConfigurableBarrier.

  • Enable consent integration with a CMPAdapter.

    If you enable consent integration events will only be tracked after the CMPAdapter returns a ConsentDecision, And only after a ConsentConfiguration is found for that adapter.

    Make sure to properly configure consent either locally, remotely or programmatically for the provided CMPAdapter to ensure proper tracking.

    Declaration

    Swift

    mutating public func enableConsentIntegration(with cmpAdapter: CMPAdapter,
                                                  forcingConfiguration block: ((_ enforcedConfiguration: ConsentConfigurationBuilder) -> ConsentConfigurationBuilder)? = nil)

    Parameters

    cmpAdapter

    The adapter that will report the ConsentDecision to the SDK

    block

    An optional block called with a configuration builder, used to force some of the ConsentConfiguration properties. Properties set with this block will have precedence to local and remote settings.