Adds the user-resettable advertising identifier (IDFA) to each tracking call and, optionally, implements the Apple Search Ads API to gather attribution information.
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:
- 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
Attributionmodule from the list of modules to install and add it each of your app targets in your Xcode project, under Frameworks > Libraries & Embedded Content
Learn more about the Swift Package Manager installation for iOS.
To install the Attribution module with CocoaPods, add the following pod to your Podfile:
Learn more about the CocoaPods installation for iOS.
To install the Attribution module with Carthage, following these steps:
Go to the app target’s General configuration page in Xcode.
Add the following framework to the Embedded Binaries section:
Learn more about the Carthage installation for iOS.
To initialize the module include it in the
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.
Learn more about the
SKAdNetwork frameworks in What Do Apple’s IDFA Changes Mean for Tealium?
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
If applicable, call
ATTrackingManager.requestTrackingAuthorization separately. Learn more about requesting tracking authorization to enable the Tealium SDK.
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.
config.skAdConversionKeys = ["EVENT_NAME": "DATA_LAYER_VARIABLE"]
The conversion value must be an
Int with a value between
63. If the conversion value is a decimal, it must be converted to an integer before calling the conversion event.
config.skAdConversionKeys = ["purchase": "conversion_value"] ... tealium?.track("purchase", dataLayer: ["order_subtotal": 456.87, "conversion_value": conversionValue])
Learn more about the
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.
Learn more about advertisement-driven app installations.
There are three main parties involved in Apple’s
- Ad networks
- Source app
- Advertised apps
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
The following diagram shows shows how Tealium works with
Learn about validating the calls to
Search Ads API
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
||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||
||Date and time the user downloaded the app||
||iOS 14+ only.
||Boolean indicating if the user allowed advertisement tracking (if
||User-resettable advertising identifier (IDFA)||
||Unique ID guaranteed to be the same across all apps on the same device from a single vendor (apps with the same 1st 2 parts of the RDNS bundle identifier. For example, com.tealium or com.acme)||
Thank you for your feedback!
This page was last updated: January 7, 2023