Install
Learn to install Tealium for Cordova.
Requirements
- Apache Cordova (9.0.0+)
Libraries
The plugin includes the following Tealium libraries:
Sample Apps
To help to familiarize yourself with our library, the tracking methods, and best practice implementation, explore the Tealium for Cordova sample app.
Install
If you are installing the Firebase remote command in your package.json
, ensure the tealium-cordova-plugin
is listed before the Firebase plugin in plugins section, to avoid any issues.
To install the Tealium library for Cordova, run the following command in your Cordova app project:
cordova plugin add tealium-cordova-plugin
Initialize
The initialize()
method initializes the Tealium Cordova plugin, as shown in the following example:
var Environment = tealium.utils.Environment;
var Collectors = tealium.utils.Collectors;
var Dispatchers = tealium.utils.Dispatchers;
var ConsentPolicy = tealium.utils.ConsentPolicy;
var config = {
account: 'ACCOUNT',
profile: 'PROFILE',
environment: Environment.dev,
dispatchers: [
Dispatchers.Collect,
Dispatchers.TagManagement,
Dispatchers.RemoteCommands
],
collectors: [
Collectors.AppData,
Collectors.DeviceData,
Collectors.Lifecycle,
Collectors.Connectivity
],
consentLoggingEnabled: true,
// consentExpiry: {
// 'time': 10,
// 'unit': 'days'
// },
// consentPolicy: ConsentPolicy.gdpr,
lifecycleAutotrackingEnabled: true,
batchingEnabled: false,
visitorServiceEnabled: true,
useRemoteLibrarySettings: false
};
window.tealium.initialize(config, function(success) {
if (success) {
console.log("Tealium initialized successfully")
}
})
This page was last updated: January 7, 2023