• 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
REMOTE COMMANDS/INTEGRATIONS

Remote Command: Contentsquare

Tealium remote command integration for Contentsquare on Android and Swift/iOS.

Requirements

  • One of these mobile libraries:
    • Tealium for Android-Kotlin (1.0.0+)
    • Tealium for Android-Java (5.9.0+ for Contentsquare 1.0.0+ or <5.9.0 for previous versions)
    • Tealium for iOS-Swift
  • One of these remote command integrations:
    • Contentsquare Remote Command JSON File (Requires Android-Kotlin 1.0.0+ or iOS-Swift 2.1.0+)
    • Contentsquare Remote Command tag in Tealium iQ Tag Management

How It Works

The Contentsquare integration uses three items:

  1. The Contentsquare native SDK
  2. The remote commands module that wraps the Contentsquare methods
  3. Either the JSON configuration file or Remote Command tag that translates event tracking into native Contentsquare calls

Adding the Contentsquare remote command module to your app automatically installs and builds the required Contentsquare libraries. If you are using a dependency manager installation, there is no need to install the Contentsquare SDK separately.

There are two remote command options: A JSON configuration file, or using iQ Tag Management to configure the mappings. A JSON configuration file is the recommended option for your vendor integration, hosted either remotely or locally within your app. If using iQ Tag Management, add the Remote Command tag for the vendor integration. Learn more about vendor integrations.

Install

Dependency Manager

We recommend using one of the following dependency managers for installation:

If you are using the Tealium iOS (Objective-C) library, use the manual installation method. The CocoaPods and Carthage options are only available if you are using the Tealium iOS (Swift) library.

    To install Contentsquare remote commands for iOS using CocoaPods:

    1. Remove tealium-swift and pod "CS_iOS_SDK" if they already exist your Podfile. The dependency for tealium-swift is already included in the TealiumContentsquare framework.

    2. Add the following dependency to your Podfile:

      pod "TealiumContentsquare"
      

      The TealiumContentsquare pod includes the following TealiumSwift dependencies:

      'tealium-swift/Core'
      'tealium-swift/TealiumDelegate'
      'tealium-swift/TealiumRemoteCommands'
      'tealium-swift/TealiumTagManagement'
      
    3. Import the modules TealiumSwift and TealiumContentsquare in your TealiumHelper file, and any other files that access the Tealium class, or the Contentsquare Remote Command.

    To install Contentsquare remote commands for iOS using Carthage:

    1. Remove tealium-swift from your Cartfile. The dependency for tealium-swift is already included in the TealiumContentsquare framework.

    2. Remove the following line if it exists in your Cartfile:

      github "ContentSquare/CS_iOS_SDK"
      
    3. Add the following dependency to your Cartfile:

      github "tealium/tealium-ios-contentsquare-remote-command"
      

    Tealium for Swift SDK (version 1.6.5+) requires the TealiumDelegate module to be included with your installation.

    To install Contentsquare remote commands for Android using Maven:

    1. Install Tealium for Android (Kotlin) or Tealium for Android (Java) and add the Tealium Maven URL to your project’s top-level build.gradle file, if you haven’t done so already.

      allprojects {
        repositories {
          jcenter()
          maven {
            url "https://maven.tealiumiq.com/android/releases/"
          }
        }
      }
      
    2. Import both the Contentquare SDK and Tealium-Contentsquare remote commands by adding the following dependencies in your app project’s build.gradle file:

      dependencies {
        implementation 'com.tealium.remotecommands:contentsquare:2.0.0'
      }
      

    Manual (iOS)

    The manual installation for Contentsquare remote commands requires the Tealium for Swift library to be installed. To install the Contentsquare remote commands for your iOS project:

    1. Install the Contentsquare SDK, if you haven’t already done so.

    2. Clone the Tealium iOS Contentsquare remote command repo and drag the files within the Sources folder into your project.

    3. Add Dispatchers.RemoteCommands as a dispatcher

    4. Set the remoteAPIEnabled configuration flag to true

    Initialize

    For all Tealium libraries, register the Contentsquare remote commands when you initialize.

    Android (Kotlin)

    Initialize remote commands with a JSON configuration file or the Remote Command tag for Tealium’s Android (Java) library.

      The following code is designed for use with the JSON Remote Commands feature, using the local file option:

      val config = TealiumConfig(application,
              "ACCOUNT",
              "PROFILE",
              Environment.DEV,
              dispatchers = mutableSetOf(Dispatchers.RemoteCommands));
      var tealium = Tealium.create(TEALIUM_MAIN, config) {
          // Initialize with `Application` in order to take advantage of consent management and other
          // advanced features
          val contentsquare = ContentsquareRemoteCommand(this);
      
          // Or for simple tracking, you can initialize without `Application`
          val contentsquare = ContentsquareRemoteCommand();
          // register the command
          remoteCommands?.add(contentsquare, filename = "contentsquare.json");
      }
      

      The following code is designed for use with the Remote Command tag feature:

      val config = TealiumConfig(application,
              "ACCOUNT",
              "PROFILE",
              Environment.DEV,
              dispatchers = mutableSetOf(Dispatchers.RemoteCommands));
      var tealium = Tealium.create(TEALIUM_MAIN, config) {
          // Initialize with `Application` in order to take advantage of consent management and other
          // advanced features
          val contentsquare = ContentsquareRemoteCommand(this);
      
          // Or for simple tracking, you can initialize without `Application`
          val contentsquare = ContentsquareRemoteCommand();
          // register the command
          remoteCommands?.add(contentsquare);
      }
      

      Android (Java)

        The JSON Remote Command file feature for Android is only available in the Kotlin SDK.

        The following code is designed for use with the Remote Command tag feature:

        import com.tealium.remotecommands.contentsquare.ContentsquareRemoteCommand;
        
        Tealium.Config config = Tealium.Config.create(application, "ACCOUNT", "PROFILE", "ENVIRONMENT");
        Tealium teal = Tealium.createInstance(TEALIUM_MAIN, config);
        
        // Initialize with `Application` in order to take advantage of consent management and other
        // advanced features
        ContentsquareRemoteCommand contentsquare = new ContentsquareRemoteCommand(this);
        
        // Or for simple tracking, you can initialize without `Application`
        ContentsquareRemoteCommand contentsquare = new ContentsquareRemoteCommand();
        
        // register the command
        teal.addRemoteCommand(contentsquare);
        

        iOS (Swift)

        Initialize remote commands with a JSON configuration file or the Remote Command tag for Tealium’s iOS (Swift) library.

          The following code is designed for use with the JSON Remote Commands feature, using the local file option:

          var tealium : Tealium?
          let config = TealiumConfig(account: "ACCOUNT",
                                     profile: "PROFILE",
                                     environment: "ENVIRONMENT",
                                     dataSource: "DATASOURCE",
                                     optionalData: nil)
          config.dispatchers = [Dispatchers.TagManagement, Dispatchers.RemoteCommands]
          config.remoteAPIEnabled = true // Required to use Remote Commands
          
          tealium = Tealium(config: config) { _ in
              guard let remoteCommands = self.tealium?.remoteCommands else {
                  return
              }
              let contentsquare = ContentsquareRemoteCommand(type: .local(file: "contentsquare"))
              remoteCommands.add(contentsquare)
          }
          

          The following code is designed for use with the Remote Command tag feature:

          var tealium : Tealium?
          let config = TealiumConfig(account: "ACCOUNT",
                                     profile: "PROFILE",
                                     environment: "ENVIRONMENT",˜˜
                                     dataSource: "DATASOURCE",
                                     optionalData: nil)
          config.dispatchers = [Dispatchers.TagManagement, Dispatchers.RemoteCommands]
          config.remoteAPIEnabled = true // Required to use Remote Commands
          
          tealium = Tealium(config: config) { _ in
              guard let remoteCommands = self.tealium?.remoteCommands else {
                  return
              }
              let contentsquare = ContentsquareRemoteCommand()
              remoteCommands.add(contentsquare)
          }
          
          

          JSON Template

          If you are configuring remote commands using a JSON configuration file, refer to the following template to get started. The template includes common mappings used in a standard e-commerce installation. Edit the mappings as needed.

          {
            "config": {},
            "mappings": {
              "screen": "screen_name",
              "dynamic_var": "dynamic_var",
              "price": "purchase.price",
              "currency": "purchase.currency",
              "transaction_id": "purchase.transaction_id"
            },
            "commands": {
              "screen_title": "sendscreenview",
              "dynamic_var": "senddynamicvar",
              "transaction": "sendtransaction",
              "stop_tracking": "stoptracking",
              "resume_tracking": "resumetracking",
              "forget_me": "forgetme",
              "opt_in": "optin",
              "opt_out": "optout"
            }
          }
          

          Supported Methods

          The following Contentsquare methods are triggered using a data mapping in the Contentsquare Remote Command tag using the following Tealium commands:

          Remote Command Contentsquare Method
          sendscreenview send()
          sendtransaction send()
          senddynamicvar send()
          stoptracking stopTracking()
          resumeTracking resumeTracking()
          forgetme forgetMe()
          optin optIn()
          optout optOut()

          Since the Contentsquare SDK is installed alongside the Tealium SDK, trigger any native Contentsquare functionality given the corresponding tag configuration.

          SDK Setup

          Initialize

          The Contentsquare SDK is initialized automatically upon launch.

          Contentsquare Developer Guide: Initial SDK Setup

          • Android
          • iOS

          Track Screens

          Remote Command Contentsquare Method
          sendscreenview send
          Parameter Type
          screen_name (required) String

          Contentsquare Developer Guide: Analytics User IDs

          • Android
          • iOS

          Track Transactions

          Remote Command Contentsquare Method
          sendtransaction send
          Parameter Type
          price (required) Double or Float
          currency (required) Int
          transaction_id (optional) String

          Contentsquare Developer Guide: Track Transactions

          • Android
          • iOS

          Track Dynamic Variables

          Remote Command Contentsquare Method
          senddynamicvar send
          Parameter Type
          dynamic_var (required) Object

          The dynamic_var parameter takes a JSON object of key-value pairs, where keys are strings and the values are either UInt32 or strings. Examples: {"my_dynamic_string_var_name": "some string value"}, {"my_dynamic_int_var_name": 123}, {"my_dynamic_string_var_name": "some string value", "my_dynamic_int_var_name": 123}.

          Contentsquare Developer Guide: Track Dynamic Variables

          • Android
          • iOS

          Stop / Resume Tracking

          Remote Command Contentsquare Method
          stoptracking stopTracking
          resumetracking resumeTracking

          Contentsquare Developer Guide: Stop / Resume Tracking

          • Android
          • iOS

          Opt In

          Remote Command Contentsquare Method
          optin optIn

          Contentsquare Developer Guide: Opt In

          • Android
          • iOS

          Opt Out

          Remote Command Contentsquare Method
          optout optOut

          Contentsquare Developer Guide: Opt Out

          • Android
          • iOS

          Forget Me

          Remote Command Contentsquare Method
          forgetme forgetMe

          Contentsquare Developer Guide: Forget Me

          • Android
          • iOS
          "Remote Command: Braze "
          Previous
          Remote Command: Braze
          Next
          Remote Command: Facebook
          "Remote Command: Facebook"

           

          Was this article helpful?

          This page was last updated: March 16, 2022      

          Thank you for your feedback!

          Table of Contents

          • Requirements
          • How It Works
          • Install
            • Dependency Manager
            • Manual (iOS)
          • Initialize
            • Android (Kotlin)
            • Android (Java)
            • iOS (Swift)
          • JSON Template
          • Supported Methods
            • SDK Setup
            • Track Screens
            • Track Transactions
            • Track Dynamic Variables
            • Stop / Resume Tracking
            • Opt In
            • Opt Out
            • Forget Me
          • 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