• 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

Install

Learn to install Tealium for Cordova.

Requirements

  • Apache Cordova (7.0.0+)
  • CocoaPods

Libraries

The plugin includes the following Tealium libraries:

  • Tealium for iOS
  • Tealium for Android

As of version 1.1.1+, framework files are no longer included in the plugin. Instead, the respective dependency managers are used for iOS and Android.

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

Install Tealium for Cordova with NPM or manually.

NPM

Node package manager (NPM) is the recommended installation type. The package name is tealium-cordova-plugin.

To install the plugin via NPM, run the following command from within your project directory:

cordova plugin add tealium-cordova-plugin

Manual

If you cannot use NPM, you may install the plugins manually.

Run the following command on the Command-Line Interface (CLI):

cd <YOUR_PROJECT_FOLDER>/
cordova platform add <PLATFORM>
cordova plugin add </LOCAL_PATH_TO_TEALIUM_PLUGIN/>
cordova build <PLATFORM>

Initialize

The init() method initializes the Tealium Cordova plugin, as shown in the following example:

tealium.init({
    account                : "ACCOUNT",
    profile                : "PROFILE",
    environment            : "ENVIRONMENT",
    datasource             : "DATASOURCE",
    instance               : "INSTANCE",
    isLifecycleEnabled     : "TRUE_OR_FALSE",
    isCrashReporterEnabled : "TRUE_OR_FALSE",
    logLevel               : tealium.logLevels.DEV,
    collectDispatchProfile : "DISPATCH_PROFILE",
    collectDispatchURL     : "DISPATCH_URL"});

By default, the core iOS and Android libraries send Tealium Collect data to the “main” profile of your account. To direct Tealium Collect to a different endpoint, either override the profile or the endpoint URL.

Override Profile example:

tealium.init({
    account                : "ACCOUNT",
    profile                : "PROFILE",
    environment            : "ENVIRONMENT",
    instance               : window.tealium_instance,
    collectDispatchProfile : "PROFILE"});

Override Endpoint URL example:

tealium.init({
    account            : "ACCOUNT",
    profile            : "PROFILE",
    environment        : "ENVIRONMENT",
    instance           : window.tealium_instance,
    collectDispatchURL : "https://collect.tealiumiq.com/vdata/i.gif?tealium_account=ACCOUNT&tealium_profile=PROFILE"});

Build Tips

If you have any issues building your app and need to remove and re-add the platform, run the following command, where PLATFORM is either "android" or "ios":

cordova platform rm PLATFORM
cordova platform add PLATFORM

This usually resolves spurious XCode code signing errors when building for a physical device.

If you experience any issues with CocoaPods while running your build, and want to clear your local CocoaPods cache, run the following command:

pod cache clean --all && pod repo update

Uninstall

To remove the Tealium plugin, run the following command:

cordova plugin rm tealium-cordova-plugin

Remove the supplementary Tealium modules, if installed:

  • tealium-cordova-crashreporter
  • tealium-cordova-adidentifier
  • tealium-cordova-installreferrer

Ionic Framework

Tealium’s Cordova plugin provides support for the Ionic Framework. To install run the following commands:

ionic cordova plugin add tealium-cordova-plugin
npm install @ionic-native/tealium

The following examples demonstrates usage of the Ionic Framework:

import { Tealium, TealConfig } from '@ionic-native/tealium/ngx';

constructor(private tealium: Tealium) { }

//...

let tealConfig: TealConfig = {
   account: "ACCOUNT",
   profile: "PROFILE",
   environment: "ENVIRONMENT",      // one of "dev", "qa" or "prod"
   isLifecycleEnabled: "true",      // enable lifecycle tracking
   isCrashReporterEnabled: "false", // disable crash reporter (Android only)
   instance: "INSTANCE"             // use the same instance name for all subsequent API calls
}

this.tealium.init(tealConfig).then(()=>{
   this.tealium.trackView({"screen_name": "homescreen"});
});
Next
Track
"Track"

 

Was this article helpful?

This page was last updated: July 7, 2021      

Thank you for your feedback!

Table of Contents

  • Requirements
  • Libraries
  • Sample Apps
  • Install
    • NPM
    • Manual
  • Initialize
  • Build Tips
  • Uninstall
  • Ionic Framework
  • 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