The Attribution module adds the user-resettable advertising identifier (IDFA) to each tracking call and, optionally, implements the Apple Search Ads API to gather attribution information. Learn more about setting up Apple Search Ads attribution.
In version 2.1.1+, the attribution module also includes SKAdNetwork support and adds the ATTransparency.AuthorizationStatus to the dispatch payload.
Use of this module is optional. Take the time to read about its functionality and decide if you need it, as it introduces additional dependencies. You are required to explain to Apple why you are using IDFA when you submit your app. If you do not state that you are using IDFA, Apple rejects your app. Learn more about IDFA usage and rejections.
The following platforms are supported:
iOS 14+: AppTrackingTransparency
iOS 14+: StoreKit
Install the Attribution module with Swift Package Manager, CocoaPods or Carthage.
Swift Package Manager (Recommended)
Supported in version 1.9.0+, the Swift Package Manager is the recommended and simplest way to install the Tealium Swift library:
In your Xcode project, select File > Swift Packages > Add Package Dependency
Enter the repository URL: https://github.com/tealium/tealium-swift
Configure the version rules. Typically, "Up to next major" is recommended. If the current Tealium Swift library version does not appears in the list, then reset your Swift package cache.
Select the Attribution module from the list of modules to install and add it each of your app targets in your Xcode project, under Frameworks > Libraries & Embedded Content
To initialize the module include it in the collectors property.
config.collectors = [Collectors.Attribution]
Attribution in iOS 14+
In iOS 14+, apps are required to receive user permission to access the device’s advertising identifier (IDFA). The user is prompted to grant “Permission to track” when the app launches for the first time. If the user declines, then the IDFA is not available to the app.
When the IDFA is not available, SKAdNetwork provides a method for registered advertising networks to attribute app installs to a campaign by receiving a signed signal directly from Apple. The advertising network only receives confirmation that the app was successfully installed, along with the campaign ID and optional conversion value.
With the attribution module enabled, the user’s tracking authorization status is automatically added to the dispatch payload as device_tracking_authorization and the value is a string representation of the ATTrackingManager.AuthorizationStatus enumeration.
Tealium automatically calls SKAdNetwork.registerAppForAdNetworkAttribution() on launch if config.skAdAttributionEnabled is set to true. This permits advertising networks to anonymously validate app installs. If the config.skAdConversionKeys dictionary is defined, then SKAdNetwork.updateConversionValue() is automatically called on the specified event and sent the value of the specified conversion key.
The following diagram shows the path of an ad’s install validation. App A is the source app that displays an ad, and App B is the advertised app that the user installs.
When a user clicks on an ad within an app or mobile web browser, the App Store is launched and the user is taken to the product screen for the ad campaign. In iOS 14.5+, advertisers have the option to choose to display a custom view-through ad or a StoreKit-rendered ad. If the user installs the advertised app, the device stores a pending install validation. If the user opens the app within an attribution time window, the device sends the install validation postback to the ad network.
The notification is signed by Apple and includes the campaign ID, but excludes user or device-specific data. The postback may include a conversion value and the source app’s ID if Apple determines that providing the values meets Apple’s privacy threshold.
There are three main parties involved in Apple’s SKAdNetwork solution:
Tealium wraps the calls to SKAdNetwork. If the TealiumAttribution module and the configuration flag are enabled, then SKAdNetwork.registerAppForAdNetworkAttribution() is called on app launch.
Additionally, if you have defined the skAdConversionKeys, then the SKAdNetwork.updateConversionValue(_:) method is called and passed in the specified conversion value. Tealium permits you to manage your calls to SKAdNetwork through the tracking you already have in place.
You may need to request tracking authorization from your users and add the appropriate keys to your .plist file.
The following diagram shows shows how Tealium works with SKAdNetwork:
To use Apple Search Ads API, enable the searchAdsEnabled property of the TealiumConfig object. Then use the iAd framework to retrieve the attribution dictionary which contains the attribution object. The Tealium library does this as soon as the app launches, but it is possible that the information is not retrieved in a timely manner. The information is added to the data layer after receiving it from Apple, typically during the launch event.
In some cases there may be several events after launch. These variables are only retrieved from Apple’s servers once during the app’s lifetime, and are stored as persistent variables so that they become available on future app launches.
The following variables are transmitted with each tracking call while the module is enabled:
Variables prefixed with ad_ are only set if Search Ads has been enabled.
The corresponding ad’s campaign ID
The corresponding ad’s campaign name
The ID of the Creative Set which the corresponding advertisement was part of.
The name of the Creative Set which the corresponding advertisement was part of.
The corresponding ad’s campaign group ID
The corresponding ad’s campaign group name
The keyword that drove the advertisement impression which led to the corresponding click
This may either be Broad, Exact or Search Match.
The corresponding ad’s campaign organization ID
The corresponding ad’s campaign organization name
Date and time the user first downloaded your app. In the case where iadconversion-type = “Redownload”, this represents the original purchase date. This may or may not have been associated with an Apple Search Ad.
Identifies the country or region associated with the campaign which drove this install.
Boolean indicating if user clicked on a Search Ads impression within 30 days prior to app download
Identifies new download or re-download of the app
Date and time the user clicked on a corresponding ad