Ad Identifier Module
Provides a Cordova wrapper for the native Android Ad Identifier module and the iOS Advertising Identifier (IDFA).
Install
To install the Ad Identifier module:
-
Navigate to your Cordova app’s directory in a terminal window
-
Run the following command:
cordova plugin add tealium-cordova-adidentifier
The Ad Identifier module has a dependency on the Google Play Services Ads module. Add your AdMob App ID to your app’s AndroidManifest.xml
file to prevent the app from crashing during startup.
Initialize
To initialize the Ad Identifier module:
-
Edit the JavaScript file, where you instantiate the main Tealium plugin, after calling
tealium.init
. -
Add the following code:
function tealiumInit(account, profile, environment, instance){ var ai; tealium.init({...}); // check if installreferrer is installed and available ai = window.tealiumAdIdentifier; if (ai) { ai.setPersistent(instance); } }
Data Layer
The Ad Identifier module adds the following variables to the data layer:
Android
google_adid
iOS
device_advertising_id
device_advertising_vendor_id
device_advertising_enabled
Uninstall
To uninstall the Ad Identifier module:
-
Run the following command:
cordova plugin rm tealium-cordova-adidentifier
-
Delete the Ad Identifier data from persistent storage:
// android only tealium.removePersistent("google_adid", <your tealium instance name>); // ios only tealium.removePersistent("device_advertising_id", <your tealium instance name>); tealium.removePersistent("device_advertising_vendor_id", <your tealium instance name>); tealium.removePersistent("device_advertising_enabled", <your tealium instance name>);
This page was last updated: November 7, 2018