Install Referrer Module
Provides the automatic collection of app installation referrer information (when available) and adds it to the data layer.
Install
Install the Install Referrer module with Maven or manually.
Maven
To install the Install Referrer module with Maven:
- In your project’s top-level
build.gradle
file, add the following Maven repository:maven { url "https://maven.tealiumiq.com/android/releases/" }
- In your project module’s
build.gradle
file, add the following Maven dependency:dependencies{ // only required if you do not have this reference implementation 'com.tealium:kotlin-core:1.6.0' implementation 'com.tealium:kotlin-install-referrer:1.1.1' // only required if you do not already have this reference and require lifecycle tracking implementation 'com.tealium:kotlin-lifecycle:1.2.0' // Google's Install Referrer API implementation 'com.android.installreferrer:installreferrer:1.0' }
The Google Install Referrer API is a dependency for this module, but is not automatically added for you. Add the module to your build.
Manual
To install the Install Referrer module manually:
-
Download the Tealium Install Referrer module.
-
In your top-level
build.gradle
file, verify the following:allprojects { repositories { mavenCentral() flatDir { dirs 'libs' } } }
-
Copy the file
tealium-kotlin.installreferrer-1.1.1.aar
into your project’s<PROJECT_ROOT>/<MODULE>/libs
directory. -
Add the Tealium library dependency to your project module’s
build.gradle
file:dependencies { // only required if you do not already have this reference implementation(name:'tealium-kotlin-1.6.0', ext:'aar') implementation(name:'tealium-kotlin.installreferrer-1.1.1', ext:'aar') // only required if you do not already have this reference and require lifecycle tracking implementation(name:'tealium-kotlin.lifecycle-1.2.0', ext:'aar') // Google's Install Referrer API implementation 'com.android.installreferrer:installreferrer:1.0' }
Data Layer
Expect the following referral data as retrieved from the Google Play
"install_referrer" - the referrer URL of the install package
"install_referrer_begin_timestamp" - the timestamp, in seconds, of when the referral click happened
"install_referrer_click_timestamp" - the timestamp, in seconds, of when the installation began
Additional Considerations
Delete the Stored Referrer
To delete the stored install referrer string, call the remove()
method on the Tealium data layer.
// remove one or all of the following keys from the data layer
tealium.dataLayer.remove(InstallReferrerConstants.KEY_INSTALL_REFERRER)
tealium.dataLayer.remove(InstallReferrerConstants.KEY_INSTALL_REFERRER_BEGIN_TIMESTAMP)
tealium.dataLayer.remove(InstallReferrerConstants.KEY_INSTALL_REFERRER_CLICK_TIMESTAMP)
This page was last updated: May 15, 2024