Install
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
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")
}
})
Was this article helpful?
This page was last updated: July 8, 2021