Attribution Module
Learn to install Tealium Attribution Module for React Native.
Tealium for React Native allows you to use the Tealium mobile libraries (iOS, Android) in your React Native application.
How it works
Tealium mobile libraries are integrated into your React Native application using one of the following two methods:
- NPM package (recommended)
- Manual via GitHub
Requirements
- Access to your native build environments
- Tealium for React Native 2.2.0 or later
- React Native 0.63 or later and tools installed
- Tealium iQ Mobile Profile
- Android Studio or Xcode
- Tealium for Android or Tealium for iOS
Install (NPM/YARN)
To install the Tealium Attribution module for React Native with NPM:
- Follow the installation instructions for the main
tealium-react-native
library installation. Ensure that you have installed at least version 2.2.0 or later. - Navigate to the root directory of your React Native project.
- Download and install the
tealium-react-native-attribution
package with the following command:yarn install tealium-react-native-attribution
JavaScript
To import the relevant classes into your app, add the following code:
import TealiumAttribution from 'tealium-react-native-attribution';
import { TealiumAttributionConfig } from 'tealium-react-native-attribution/common';
Initialize
Configure the Attribution
module prior to initializing the main Tealium React Native integration. This integration optionally enables Tealium Swift Attribution Module, as well as the Tealium Kotlin Install Referrer and Ad Identifier. Use TealiumAttributionConfig
parameters to enable settings as needed.
let attributionConfig: TealiumAttributionConfig = {
androidInstallReferrerEnabled: true,
androidAdIdentifierEnabled: true,
iosSearchAdsEnabled: true,
iosSkAdAttributionEnabled: true,
iosSkAdConversionKeys: {"event": "conversion_value"}
}
TealiumAttribution.configure(attributionConfig);
API Reference
After the Attribution Module and the main Tealium React Native integration have both been initialized, you can optionally clear ad data.
removeAdInfo()
Clears values and removes ad information from the data layer related to the Tealium Android Ad Identifier module (Android only).
TealiumAttribution.removeAdInfo();
removeAppSetIdInfo()
Clears values and removes app set Id form the data layer related to the Tealium Android AdIdentifier module (Android only).
TealiumAttribution.removeAppSetIdInfo();
This page was last updated: July 11, 2024