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
  • Tracking SDK Setup
  • Tracking, Identify and Updating Users
  • Additional options
  • Accessing the xngGlobalUserId and xngSessionId
  • Tracking Opt-Out
  1. Data & Engagement Platform
  2. Web Tracking

Migrate Tracking SDK v1 -> v2

PreviousTesting & DebuggingNextMobile Web Tracking

Last updated 3 months ago

This section is aimed to touch on the most important topics related to migrating from our old tracking SDK to the new SDK. If there are any questions/uncertainties in the process of migration, please .

Tracking SDK Setup

Exchange the HTML snippet loading the tracking SDK with our tracking template or with the updated HTML snippet visible in the System Setup section of your CrossEngage instance and apply the same trigger logic as previously used.

Please read the section of our documentation for information around using the GTM-Template as well as further information on additional options and configurations.

The new Tracking SDK opts any user out from tracking by default. This means that no user tracking will occur until the configuration ce({trackingOptIn: true}); has been set.

Tracking, Identify and Updating Users

Formats and payloads of the tracking data has not changed. Only the API to provide these is slightly different.

Please make sure to visit all your tags triggering updates to CrossEngage and change the tags according to the documentation below.

Because identifying and updating are now separated, you might need to split a previous analytics.identify where both was done in one API call. In that case, just send the update with the attributes after the identify.

Tracking SDK v1 (Legacy)
Tracking SDK v2

Viewed Page tracking event

analytics.page();

Viewed Page tracking event

ce('track', 'Viewed Page');

Any tracking event (default or custom)

analytics.track('Added Product', {properties});

Any tracking event (default or custom)

ce('track', 'Added Product', {properties});

Identify a user by externalId

analytics.identify('123-456');

Identify a user by externalId

ce('identify', '123-456');

Identify a user by email

analytics.identify({ email: 'test@test.com' });

Identify a user by email

ce('identify', { email: 'test@test.com' });

Setting or updating user attributes

analytics.identify({ name: 'Peter Smith', age: 59, city: 'Berlin' });

Setting or updating user attributes

ce('update', { name: 'Peter Smith', age: 59, city: 'Berlin' });

Additional options

You might have used a global additionalOptions variable to make sure that certain properties always get added to the event payload of every tracking event.

In the new tracking SDK this functionality can be recreated by configuring it with globalEventProperties(see Configuration & Config Commands). In the new tracking SDK this configuration is readable and can be set and updated at any time.

All properties within globalEventProperties will get added to the properties property of any track, identify or update event call.

When migrating this to the new SDK, make sure your additional properties are nested in the correct and desired way as they were before.

Accessing the xngGlobalUserId and xngSessionId

To provide a safer and more future proof way to maintain cookies and other forms of persistent storage, we strongly recommend to never read or write any cookies or other CrossEngage related storage values directly.

Instead the xngGlobalUserId and xngSessionId can be read and set as part of the configuration (see Configuration & Config Commands) if needed. We have also changed and update various cookie names and references. Old cookies will be converted and deleted when the new tracking SDK detects them.

Tracking SDK v1 (Legacy)
Tracking SDK v2

xng.gid

ce.guid

xng.sid

ce.sid

xng.tracking-opt-out

ce.tracking-opt-in

Tracking Opt-Out

The old tracking library provided multiple methods to set the tracking optIn/OptOut status, like xng.setTrackingOptOut() etc. and other methods to check the opt out status.

To ensure user privacy is handled correctly, the new tracking SDK will opt out from tracking by default and tracking opt in must be enabled via the configuration to enable tracking like this: ce({trackingOptIn: true}); As the tracking optIn status is now a configuration, it can be set and read as described in .

📨
reach out to the CrossEngage support
setup
Configuration