Documentation
APICreate a Ticket
  • 📔Documentation Guide
  • 📨Data & Engagement Platform
    • Data Model
      • Customer Data
      • Product Catalogue
      • Events
        • Onsite Events
        • Outbound Events
        • Transactions
    • App User Management
      • User Roles
      • App Users
    • Data Management
      • Data Management with API
      • Data Management with Data Feeds
        • Users
          • Import Users
          • Update or Delete a User Trait via File Upload
          • List of Standard User Traits/Attributes
        • Products
        • Events
          • Import Orders
          • Import Events
          • List of Events and Properties
      • Data Export
    • Web Tracking
      • Web Tracking v1 (Legacy)
        • Setup
        • Set up business Units
        • Tracking User Behavior
          • Identify Method
          • Page Method
          • Track Method
          • Opt-Out from Tracking
        • Testing & Debugging
      • Web Tracking v2
        • Setup using Google Tag Manager
        • Setup without a Tag Manager
        • Configuration & Config Commands
        • Tracking User Behavior
          • Identify Method
          • Update Method
          • Page Method
          • Track Method
          • Opt-Out from Tracking
        • Testing & Debugging
      • Migrate Tracking SDK v1 -> v2
      • Mobile Web Tracking
    • User Segmentation
      • Creating a Segment
      • Conditions
      • Combining Segments
    • Messages
      • Frequency Capping
      • Templates
        • Template Builder
      • Integrations
        • Channels
          • SMS
            • Twilio
              • Set up a Twilio Account
              • Set up Twilio Integration
              • Create a Campaign Message
            • Link Mobility
              • Set Up Link Mobility Account
              • Set up Link Mobility Integration
              • Create a Campaign Message
          • SFTP
            • Set up SFTP Integration
            • Create a Campaign Message
          • Direct Mail
            • Optilyz
              • Set up Optilyz Integration
              • Create a Campaign Message
          • Webhooks
            • Single Webhook
              • Set up Webhook Integration
              • Create a Campaign Message
              • Response Data and Custom Events
            • Batch Webhook
              • Set up Batch Webhook Integration
              • Create a Campaign Message
            • Zenloop via CrossEngage Webhook
              • Set up Zenloop Integration (via CrossEngage Webhook)
              • Set up Zenloop Survey
              • Create a Campaign Message
              • Set up Zenloop Survey via ESP
              • Obtain Response Data
            • Google Analytics via Webhook
          • Segment Transfer
            • Facebook
              • Set up Facebook Developer Account
            • Optimizely
              • Set up Optimizely Account
            • Google Analytics
              • Set up Google Analytics Integration
              • Create a Campaign with Google Analytics
              • Using the Google Analytics Integration
            • Airship
              • Set up an Airship Account
              • Set up an Airship Integration
              • Create a Campaign Message with Airship
          • Onsite Display
            • Trbo
              • Set up Trbo Integration
              • Create a Campaign Message in CrossEngage
              • Configure Campaign Message in Trbo
              • Obtain Response Data
          • Email
            • Mailjet
              • Set up Mailjet Integration
              • Obtain Response Data via Webhook
              • Create a Campaign Message
              • Personalize Preview Texts in Mailjet
            • Mandrill (by MailChimp)
              • Set up Mandrill Integration
              • Obtain Response Data via Webhook
              • Create a Campaign Messege
            • Inxmail
              • Set up Inxmail Integration
              • Create a Campaign Message
            • Sendgrid (by Twilio)
              • Set up SendGrid Integration
              • Obtain Response Data via Webhook
              • Create a Campaign Message
            • Mailgun
              • Set up Mailgun Integration
              • Obtain Response Data via Webhooks
              • Create a Campaign Message with Mailgun
            • Episerver (Optimizely)
              • Set up Episerver Integration
              • Create a Campaign Message with Episerver
          • Push Notifications
            • Airship
              • Set up an Airship Account
              • Set up an Airship Integration
              • Create a Campaign Message with Airship
        • Attachments
        • Delete an Integration
      • Personalization
        • Import Data
          • User Profile Data
          • Campaign Data
          • Cart Data
        • Formatting Functions
          • Date Formatting
          • Number Formatting
          • String Formatting
          • Hash Functions
        • General Helper Functions
          • Conditional Functions
          • Filtering Arrays
        • Product Helper Functions
          • Fetch from Product Feed
          • Fetch from Tracking Event
          • Fetch from User Journey
        • Misc. Helper Functions
          • Voucher Helper Function
            • Vouchers: Use Case
          • Event Helper Functions
          • Opt Out Helper Functions
        • Operators
      • Vouchers
        • Creating Vouchers
        • Using Vouchers
    • Campaign Management
      • Campaigns
        • Create an Audience Campaign
        • Create a Real-Time Campaign
        • Control Group
      • Stories
        • Building a Story
        • Use Case: Welcome Story
      • Segment Transfer
        • Create a Segment Transfer Campaign
    • Consent Management
      • Subscription/Consent Management
      • System Opt-Out/Opt-In
      • System Blacklist/Whitelist
    • Prediction Models
      • Create a new Model
      • Feature Engineering
      • SQL Filter
    • System Monitoring
      • Dashboard
        • Segment Tracker
      • Events Overview
      • Activity Log
      • Slack Notifications
        • Setting up Slack Notifications
    • Help & Support
      • System Status
      • Reach out to Customer Support
      • Suggest an Improvement
      • Privacy Policy
    • Glossary - Data & Engagement
  • 📈Predictions Platform
    • Data Model
      • Customer Data
      • Transactions
      • Activities
    • Overview
      • Data Tab
        • Data Tables in the Predictions Platform
      • Insights Tab
      • Model Builder Tab
        • Feature Engineering
        • Custom SQL Filter
        • Model Report
      • Prediction Tab
      • Selections Tab
    • Tutorials
      • Prepare and Validate Data
      • Analyze RFM Customers
      • Create a new Model
      • Predict Campaign Profit
    • Glossary - Predictions
Powered by GitBook
On this page

Last updated 3 months ago

Configuring the tracking SDK

The tracking SDK can be configured at any time by providing an object with the desired settings (see list below). However, some settings like apiKey need to be set as the first command when initialising the SDK.

This is why a configuration command with this configuration is already included in the HTML Snippet (or GTM Tag Template) and it can be expanded with additional configurations.

Reading the Configuration

The current configuration and its values can also be read by using a callback command. Note that the configuration can not be changed by manipulating the returned configuration, but must be configured as described above.

To read the current configuration or just insert a custom operation into the command queue, you can use a Callback Command. These take a function as argument, which will inserted and executed via the command queue. The function will be called with an immutable copy of the current (at time of execution) configuration.

Possible Configuration Properties:

// Interface:
ce({
  [configuration property]: [value]
  [configuration property]: [value]
});

// Example:
ce({
  silentLogs: true,
  rootDomain: 'example.com'
});
// Interface: 
ce(function(configuration) {
  //...
});

// Example:
ce(function(configuration) {
  console.log(configuration.globalUserId)
});
  1. 📨Data & Engagement Platform
  2. Web Tracking
  3. Web Tracking v2

Configuration & Config Commands

PreviousSetup without a Tag ManagerNextTracking User Behavior

Property

value type

default value

description

apiKey

String

-

The Tracking API Key of your company. The first command of the SDK must set this value.

apiUrl

String

The CrossEngage Tracking API to which all tracking requests are being made. Usually this should not be changed.

globalEvent Properties

Javascript Object

{}

This configuration can be used to add specific properties and values to all tracking events that get passed to the tracking API. The properties will be added to the properties part of the payload of the request.

globalUserId

String

null

The xngGlobalUserId by which the user is tracked globally within the system. If this value is not set, it will be set automatically after the first request to the CrossEngage API, assigning the user this id.

When set, it will add a cookie to the users browser to store this setting and apply it on the next page load.

It is not recommended, but for very specific use cases this value can be manually overwritten as well.

rootDomain

Boolean or String

false

As cookies are used to track a user across sessions, these cookies are always set to a specific domain. Usually this is the exact (sub)domain that the tracking SDK has been loaded on. If you want the cookie to be set on a higher domain level or even the root domain, this setting can be used either by providing the exact domain name that the cookie should use or the boolean value true to let the SDK identify and use the root domain automatically.

sessionId

String

null

The sessionId by which the users current session is tracked globally within the system. If this value is not set, it will be set automatically after the first request to the CrossEngage API, assigning the user this id.

When set, it will add a cookie to the users browser to store this setting and apply it on the next page load.

It is not recommended, but for very specific use cases this value can be manually overwritten as well.

silentLogs

Boolean

false

By default, the tracking SDK displays a variety of usable errors and warnings in the developer console of the browser, if required. These errors and warnings can be disabled entirely, allowing only low level Javascript runtime errors to pass.

trackingOptIn

Boolean

false

By default, the tracking SDK will be in a non-tracking mode. It will execute and run all its internal code logic and functions, but will not make any http request to the CrossEngage tracking API. This configuration will allow requests to the API when enabled, which is required for user tracking. When true, it will add a cookie to the users browser to store this setting and apply it on the next page load.

forceEnablePolling

Boolean

false

By default, polling is disabled if no onsite, exit intent or browser notification integration is enabled. With this config, the polling can be enabled to e.g. allow fixing wrongly merged users.

https://trk-
api.crossengage.io/
api/v1