Install Referrer Module
Provides a Cordova wrapper for the native Android Install Referrer module.
Install
This feature is available as a separate NPM package.
To install the Install Referrer module:
-
Navigate to your Cordova app’s directory in a terminal window.
-
Run the following command:
cordova plugin add tealium-cordova-installreferrer
Initialize
To initialize the Install Referrer module:
-
Edit the JavaScript file where you instantiate the main Tealium plugin, after calling the
tealium.init()
method. -
Add the following code:
function tealiumInit(account, profile, environment, instance){ var ir; tealium.init({...}); // check if installreferrer is installed and available ir = window.tealiumInstallReferrer; if (ir) { // init install referrer and store any received values as persistent data ir.setPersistent(instance); } }
Test
Once the plugin has been installed, test it by manually triggering a system broadcast.
Substitute com.tealium.sample
with the RDNS bundle identifier for your app (unless testing with the Tealium sample app).
adb shell
am broadcast -a com.android.vending.INSTALL_REFERRER -n "com.tealium.sample/com.tealium.installreferrer.InstallReferrerReceiver" --es "referrer" "utm_source=mysource&utm_medium=mymedium&utm_term=myterm&utm_content=46b25e284dc36d5a7ef8f0e6b393febe3fcc8327&utm_campaign=mycampname"
Uninstall
To uninstall the Install Referrer module:
-
Run the following command:
cordova plugin rm tealium-cordova-installreferrer
-
Delete the Install Referrer data from persistent storage:
tealium.removePersistent("install_referrer", <your tealium instance name>);
This page was last updated: November 7, 2018