The Web Extend data collection scripts track visitor interactions on your website and process this information to serve validated data to various Emarsys applications, such as Smart Insight, Predict, Interactions or the Automation Center.
This page describes the steps required to implement these scripts.
Data protection
Emarsys is committed to helping you maintain a clean and compliant database, by enabling you to adhere to any data protection regulations. To learn more about how Web Extend relates to GDPR, please see:
Before you start
- The Web Extend scripts are executed asynchronously and have no effect on your website’s speed and performance.
- The Web Extend scripts manage user data in anonymous or pseudonymized form; only after the data has been imported into the Emarsys database is the web behavior associated with actual contacts.
- You don’t just want to collect data on all your current web pages, you also want to do so on all the new pages you add to your website in the future. These include new product pages and the landing pages you create for marketing campaigns. So make sure that you also add the relevant commands to the templates you use for creating different page types.
- If you maintain a dedicated mobile version of your website or have a mobile app, make sure to add the Web Extend data collection scripts to these as well.
In order to use Web Channel, you only need to perform steps 1 and 2.
Implementation steps
First, you need to create a basis for data collection: you have to be able to track what users do on your website and you need to identify your customers, too.
Step 1. Add tracking code to your website
This code makes it possible for you track the behavior of your visitors on your website using our JavaScript API commands, and it is also the basis of cross-device user identification and campaign tracking. Its implementation is a prerequisite of using those Emarsys products, such as Web Channel or Predict, that rely on the Web Extend data collection scripts.
For the technical details, see: tracking code (Web Extend).
Step 2. User identification
By default, Emarsys uses cookies to keep track of website visitors. However, in order to match visitors with contacts in your contact database we have to explicitly identify known visitors, such as logged-in users or otherwise anonymous visitors who enter their email address on your website. This is the basis of cross-device user identification.
For the technical details, see: user identification (Web Extend).
Step 3. Implementing the e-commerce JavaScript commands
Prerequisites for the e-commerce commands
- You have selected a base currency for your account.
- You have uploaded your product data file.
- Before implementing the Web Extend scripts, discuss your data collection and contact identification policy with Emarsys Support.
The e-commerce commands
These scripts ensure that the right data makes its way from your website to the right places in your database, so that it can be used for reporting, recommendation, prediction, lifecycle management and many other functions.
Add the following commands to ALL pages on your website:
The following commands should only be included on specific pages on your website:
Make sure that the JavaScript API commands are never cached. In most template-based web shop engines, caching is set on specific paths – always make sure that the templates in which you implement these API commands are never in a cached path, as this will cause the API to report erroneous data.
Use these JSFiddle examples below to see these commands in action. Use the Live Events viewer in the Web Behavior box on the Predict Data Sources page to check if your implementation works.
JSFiddle working code example for product pages:
JSFiddle working code example for category pages:
JSFiddle working code example for the order confirmation page:
And you're done
Once you have completed the above steps and successfully validated your integration, data collection and the enrichment of contact data through the behavior fields is continuous.
Please remember to check back on your integration’s health by visiting the Predict Data Sources page every once in a while, and at least after each change of the website front end (to ensure other updates to the pages have not corrupted the data collection scripts).