• Platforms
  • Partners
  • Forums
  • 日本語
  • TLC Tealium Learning Center Tealium Learning
    Community
  • Discussions & Ideas Dicussions & Ideas
  • Product Guides Product Guides
  • Knowledge Base Knowledge Base
  • Developer Docs Developer Docs
  • Education Education
  • TLC Blog TLC Blog
  • Support Desk Support Desk
  • CDH Customer Data Hub Customer Data Hub
  • Mobile
  • Getting Started
    • Overview
    • Quick Start Guide
    • Mobile Concepts
    • Client-Side
    • Server-Side
    • Tracking Webviews
    • Data Layer
    • Consent Management
    • Event Batching
    • User Location and Geofencing
    • Media Tracking
    • Deep Links
    • Timed Events
    • Trace
    • Hosted Data Layer
    • Adobe Visitor Service Module
    • Feature Comparison
    • Troubleshooting
  • Remote Commands
    • Overview
    • How It Works
    • Integrations
      • Adjust
      • AppsFlyer
      • Branch
      • Braze
      • Contentsquare
      • Facebook
      • Firebase
      • Kochava
      • Usabilla
  • Android (Java)
    • Overview
    • Install
    • Track
    • Data Layer
    • Data Management
    • Consent Management
    • Module List
      • Ad Identifier Module
      • Crash Reporter Module
      • Install Referrer Module
      • Lifecycle Tracking Module
      • Location Module
      • Optimizely X Tracking Module
    • Android TV
    • Android Wear
    • API Reference
      • ConsentManager
      • DataSources
      • Lifecycle
      • Tealium
      • Tealium.Config
      • TealiumLocation
    • Release Notes
  • Android (Kotlin)
    • Overview
    • Install
    • Track
    • Data Layer
    • Consent Management
    • Identity Resolution
    • Module List
      • Ad Identifier Module
      • AutoTracking Module
      • AdobeVisitorService Module
      • Collect Module
      • Collectors Module
      • Crash Reporter Module
      • In-App Purchase Module
      • Install Referrer Module
      • Lifecycle Tracking Module
      • Location Manager Module
      • Media Module
      • RemoteCommands Module
      • Tag Management Dispatcher Module
      • Visitor Service Module
    • Android TV
    • API Reference
      • ConsentCategory
      • ConsentManager
      • CurrentVisit
      • DataLayer
      • Lifecycle
      • LocationManager
      • Media
      • Tealium
      • TealiumConfig
      • VisitorProfile
      • VisitorService
    • Release Notes
  • Cordova 1.x
    • Overview
    • Install
    • Track
    • Data Management
    • Module List
      • Ad Identifier Module
      • Crash Reporter Module
      • Install Referrer Module
    • API Reference
    • Release Notes
  • Cordova 2.x
    • Overview
    • Install
    • Track
    • API Reference
    • Release Notes
  • Flutter 1.x
    • Overview
    • Install
    • Track
    • Consent Management
    • Data Management
    • API Reference
    • Release Notes
  • Flutter 2.x
    • Overview
    • Install
    • Track
    • Consent Management
    • Data Management
    • API Reference
      • Tealium
      • TealiumConfig
      • VisitorProfile
    • Release Notes
  • iOS (Objective-C)
    • Overview
    • Install
    • Track
    • Data Layer
    • Data Management
    • Consent Management
    • Tag Management
    • Module List
      • Lifecycle Tracking Module
    • tvOS
    • watchOS
    • API Reference
    • Release Notes
  • iOS (Swift) 1.x
    • Overview
    • Install
    • Track
    • Data Layer
    • Data Management
    • App Extensions
    • Identity Resolution
    • Consent Management
    • Modules
    • Module List
      • AppData Module
      • Attribution Module
      • AutoTracking Module
      • Collect Module
      • Connectivity Module
      • CrashReporter Module
      • DataSource Module
      • DefaultStorage Module
      • Delegate Module
      • DeviceData Module
      • DispatchQueue Module
      • FileStorage Module
      • Lifecycle Module
      • Location Module
      • Logger Module
      • PersistentData Module
      • RemoteCommands Module
      • TagManagement Module
      • VisitorService Module
      • VolatileData Module
    • Feature Comparison
    • Working with Objective-C
    • API Reference
      • TealiumConfig
      • TealiumConsentCategories
      • TealiumConsentManagerDelegate
      • TealiumConsentManager
      • TealiumInstanceManager
      • TealiumPersistentData
      • TealiumVolatileData
      • Tealium
    • Release Notes
  • iOS (Swift) 2.x
    • Overview
    • Install
    • Track
    • Data Layer
    • Consent Management
    • App Extensions
    • Identity Resolution
    • Modules
    • Module List
      • AppData Module
      • AdobeVisitorService Module
      • Attribution Module
      • AutoTracking Module
      • Collect Module
      • Connectivity Module
      • CrashReporter Module
      • DeviceData Module
      • In-App Purchase Module
      • Lifecycle Module
      • Location Module
      • Media Module
      • RemoteCommands Module
      • TagManagement Module
      • VisitorService Module
    • Working with Objective-C
    • API Reference
      • LocationModule
      • MediaSession
      • Tealium
      • TealiumConfig
      • TealiumConsentCategories
      • TealiumConsentManager
      • TealiumDataLayer
      • TealiumInstanceManager
    • Release Notes
  • NativeScript
    • Overview
    • Install
    • Track
    • API Reference
      • Tealium
      • TealiumConfig
    • Release Notes
  • React Native 1.x
    • Overview
    • Install
    • Track
    • API Reference
    • Release Notes
  • React Native 2.x
    • Overview
    • Install
    • Track
    • Location Module
    • API Reference
    • Release Notes
  • Unity 1.x
    • Overview
    • Install
    • Track
    • API Reference
  • Unity 2.x
    • Overview
    • Install
    • Track
    • API Reference
  • Xamarin 1.x
    • Overview
    • Install
    • Track
    • Data Management
    • Consent Management
    • API Reference
    • Release Notes
  • Xamarin 2.x
    • Overview
    • Install
    • Track
    • Data Layer
    • Consent Management
    • API Reference
    • Release Notes
  • Web
  • Getting Started
    • Overview
    • Quick Start Guide
    • Web Concepts
    • Data Layer
      • An Introduction to the Data Layer
      • How the Data Layer Works for Websites
      • Data Layer Best Practices
      • Definitions
        • Retail
        • Publisher
        • Hotel
        • Travel
        • Basic Video Tracking
  • Adobe Launch
    • Overview
    • Install
    • Data Layer
  • AMP
    • Overview
    • Install
    • Track
    • Data Layer
  • Angular
    • Overview
    • Install
    • Track
    • API Reference
  • Google Tag Manager
    • Overview
    • Install
    • Data Layer
  • JavaScript (Web)
    • Overview
    • Install
    • Track
    • Data Layer
    • Universal Data Object (utag_data)
    • Universal Tag (utag.js)
    • Data Layer Object (b)
    • Single-Page Applications
    • Settings
    • Debugging
    • API Reference
      • Cookie Functions
      • GDPR Functions
      • Tracking Functions
      • Utility Functions
    • Release Notes
  • Server
  • C#
    • Overview
    • Install
    • Track
    • Data Layer
    • API Reference
    • Release Notes
  • HTTP API
    • Overview
    • Endpoint
    • Data Layer
  • Java
    • Overview
    • Install
    • Track
    • API Reference
    • Release Notes
  • Node
    • Overview
    • Install
    • Track
    • API Reference
  • Python
    • Overview
    • Install
    • Track
    • API Reference
  • Roku
    • Overview
    • Install
    • Track
    • API Reference
  • Ruby
    • Overview
    • Install
    • Track
    • API Reference
CORDOVA V1

API Reference

Reference guide for classes and methods provided by Tealium for Cordova.

Class: Tealium

The following summarizes the commonly used methods of the Cordova Tealium class.

Method Description
addPersistent() Adds data to the Tealium persistent data store
addVolatile() Adds data to the Tealium volatile data store
init() Initializes the Tealium Cordova plugin
getPersistent() Returns a value from the Tealium persistent data
getVisitorID() Returns the current Tealium visitor ID for the current user
getVolatile() Returns a value from the Tealium volatile data store
removePersistent() Removes data from the Tealium persistent data store
removeVolatile() Removes volatile data from the Tealium volatile data store
track() Track views by passing "view" as the first argument type, or track events by passing "link" as the first argument type
trackEvent() Tracks all non-view activity
trackView() Tracks every time a user opens or changes a screen in the app

addPersistent()

Adds persistent data to the Tealium persistent data store.

tealium.addPersistent(key, data, instance);
Parameter Type Description Example
key String Key name of value to be persisted "user_hashed_email"
data String or [String] The value to be persisted for this key ["testpersist", "testpersist2"]
instance String Arbitrary instance name constant, used to refer to a specific tracking instance "tealium_main"

addVolatile()

Adds data to the Tealium volatile data store.

tealium.addVolatile(key, data, instance);
Parameter Type Description Example
key String Key name of value to be persisted "user_hashed_email"
data String or [String] The value to be persisted for this key ["testvolatile1", "testvolatile2"]
instance String Arbitrary instance name constant, used to refer to a specific tracking instance "tealium_main"

init()

Initializes the Tealium Cordova plugin.

tealium.init(config, successCallBack, errorCallback);
Parameter Type Description
config JavaScript/JSON object The config object (see table below)
successCallback Function Overrides the default Success Callback to allow custom success handling
errorCallback Function Overrides the default Success Callback to allow custom success handling

The config object is passed as the first argument, and contains the following data:

tealium.init({account, profile, environment, instance,
                isLifecycleEnabled,
                collectDispatchURL,
                collectDispatchProfile,
                isCrashReporterEnabled,
                logLevel,
                dataSourceId});
Parameter Type Description Example
account String Tealium account name "companyXYZ"
profile String Tealium profile name "main"
environment String Tealium environment name ["dev", "qa", "prod"]
instance String Tealium instance name (multiple instances supported) "tealium_main
isLifecycleEnabled String (Optional) String value “true” or “false” to enable lifecycle tracking (default: "true") ["true", "false"]
collectDispatchURL String Override the full Tealium Collect endpoint URL "https: //collect. tealiumiq.com/ vdata/i.gif ?tealium_account =companyXYZ &tealium_profile =main"
collectDispatchProfile String Set the profile to use in the Tealium Collect endpoint "cordova-demo"
isCrashReporterEnabled String (Optional and for Android only) Enable crash reporting (uncaught exception handler) ["true", "false"]
logLevel String (Optional) Set the log level (defaults to your environment) tealium.logLevels.DEV (Info, Warnings, Errors), tealium.logLevels.QA (Warnings, Errors), tealium.logLevels.PROD (Errors Only), tealium.logLevels.SILENT (No Logs)
dataSourceId String (Optional) The data source key “abc123”

getPersistent()

Returns a value from the Tealium persistent data. Returns null on the JavaScript side if the requested data could not be found.

tealium.getPersistent(key, instance, callback);
Parameter Type Description Example
key String Key name of value to be retrieved from persistent storage "user_hashed_email"
instance String Arbitrary instance name constant, used to refer to a specific tracking instance "tealium_main"
callback Function Callback object to return the value requested from the persistent storage null

getVisitorID()

Returns the current Tealium visitor ID for the current user.

Returns Return Type
Current visitor ID String

getVolatile()

Returns a value from the Tealium volatile data store. Returns null on the JavaScript side if the requested data could not be found.

tealium.getVolatile(key, instance, callback);
Parameter Type Description Example
key String Key name of value to be retrieved from volatile storage "user_hashed_email"
instance String Arbitrary instance name constant, used to refer to a specific tracking instance "tealium_main"
callback Function Callback object to return the value requested from the persistent storage null

removePersistent()

Removes persistent data from the Tealium persistent data store.

tealium.removePersistent(key, instance);
Parameter Type Description Example
key String Key name of value to be removed from persistent storage "user_hashed_email"
instance String Arbitrary instance name constant, used to refer to a specific tracking instance "tealium_main"

removeVolatile()

Removes volatile data from the Tealium volatile data store.

tealium.removeVolatile(key, instance);
Parameter Type Description Example
key String Key name of value to be removed from volatile memory "user_hashed_email"
instance String Arbitrary instance name constant, used to refer to a specific tracking instance "tealium_main"

track()

Track views by passing "view" as the first argument type, or track events by passing "link" as the first argument type.

tealium.track(type, data, instance);
Parameter Type Description Example
type String Tealium event type name - "link" (event) or "view" (screen view) ["link", "view"]
data JavaScript/JSON object Populates the data layer for this tracking call with the key-value pairs specified {"tealium_event" : "page_view"}
instance String Tealium instance name - refers to a specific tracking instance "tealium_main"

trackEvent()

Tracks all non-view activity.

tealium.trackEvent(data, instance);
Parameter Type Description Example
data JavaScript/JSON object Event data as key-value pairs {"tealium_event": "cart_add"}
instance String Tealium instance name - refer to a specific tracking instance "tealium_main"

trackView()

Tracks every time a user opens or changes a screen in the app.

tealium.trackView(data, instance);
Parameter Type Description Example
data JavaScript/JSON object `View data as key-value pairs {tealium_event:"screen_view", "screen_name":"Homescreen"}
instance String Tealium instance name "tealium_main"
"Data Management "
Previous
Data Management
Next
Release Notes
"Release Notes"

 

Was this article helpful?

This page was last updated: July 7, 2021      

Thank you for your feedback!

Table of Contents

  • Class: Tealium
    • addPersistent()
    • addVolatile()
    • init()
    • getPersistent()
    • getVisitorID()
    • getVolatile()
    • removePersistent()
    • removeVolatile()
    • track()
    • trackEvent()
    • trackView()
  • Platforms
  • Partners
  • Forums
  • Mobile
  • Getting Started
  • Remote Commands
  • Android (Java)
  • Android (Kotlin)
  • Cordova 1.x
  • Cordova 2.x
  • Flutter 1.x
  • Flutter 2.x
  • iOS (Objective-C)
  • iOS (Swift) 1.x
  • iOS (Swift) 2.x
  • NativeScript
  • React Native 1.x
  • React Native 2.x
  • Unity 1.x
  • Unity 2.x
  • Xamarin 1.x
  • Xamarin 2.x
  • Web
  • Getting Started
  • Adobe Launch
  • AMP
  • Angular
  • Google Tag Manager
  • JavaScript (Web)
  • Server
  • C#
  • HTTP API
  • Java
  • Node
  • Python
  • Roku
  • Ruby