Data Layer Enrichment

Data Layer Enrichment

by Community Manager on ‎03-21-2017 01:50 PM - edited 4 weeks ago by Community Manager (198 Views)

Data Layer Enrichment* (DLE) facilitates the use of static hosted data for the purpose of supplementing the dynamic on-page data layer of your website. The data layer implemented on your website is great for capturing real-time data of a customer's visit, but we understand it can be a challenge to build out your data layer to contain all the valuable data available to your organization.  DLE provides a convenient mechanism to upload your static data to the Tealium mCDN where it can easily be accessed by your web pages to enrich the on-page data. This article gives an overview of this feature and the components needed for a full DLE implementation.

* Not to be confused with the Data Layer Enrichment for AudienceStream.

In this article:

Table of Contents Placeholder

How It Works

First, a data layer enrichment (DLE) is a micro data layer associated to a variable in your on-page data layer. A DLE object is a text file containing a JSON object with the key/value pairs representing the micro data layer. This file is uploaded to the mCDN using the DLE API. The on-page data layer contains lookup variables that are used to determine which DLE object to fetch from the mCDN. These lookup variables are configured using the DLE Extension in iQ. Let's take a closer look at these two components.

Data Layer Enrichment API

The DLE API allows you to upload the enrichment data to the mCDN in a flat JSON object called a Data Layer Enrichment (DLE) object. The API makes it possible to programmatically process large amounts of data to be used as DLE objects.

Here is the example contents of a DLE object:

    "product_category"           : ["Accessories"],
    "product_brand"              : ["Acme"],
    "product_sku"                : ["GEN-PRD-BLU"],
    "product_has_free_shipping"  : ["0"],
    "product_has_instore_pickup" : ["1"]

You can see that a DLE object looks very similar to the data layer object on your web site. While the on-page data layer describes the page and customer interactions, the DLE object describes a specific variable within that data layer. In this example, it provides additional attributes for a specific product.

Learn how to use the Data Layer Enrichment API.

Data Layer Enrichment Extension

This is the component that performs the enrichment. The DLE extension fetches the hosted DLE objects and merges their contents into the on-page data layer. The extension is configured to identify the data layer variables (lookup variables) that are used to determine which DLE objects are used for enrichment. Learn how to set up the Data Layer Enrichment extension.

Lookup Variable

A lookup variable identifies which variable in the on-page data layer will be used to fetch the appropriate DLE object to be used for enrichment. Simply put, the lookup variable becomes the common thread between the DLE objects and the DLE extension. For this reason, you must identify your lookup variables first, then use the expected values of that variable as the names of your DLE objects. For example, if your lookup variable is platform and one of its values is "iOS", the corresponding DLE object would be named "iOS.js".

Mechanics of Enrichment 

It all begins when utag.js loads on the page. The DLE extension runs first and instantly pauses utag.js so that none of the Tags, Load Rules, and other Extensions are evaluated. This ensures that enrichment data can still be used in these vital components of your configuration. During this time, the lookup variables are identified and their values used to fetch the matching DLE objects from the mCDN. If a DLE object is found, its data is merged into the on-page data layer, successfully enriching it. After all lookup variables are processed and the data layer enrichment is complete, the extension releases the pause and utag.js continues its operation.

In summary:

  1. DLE API used to upload JSON data files to mCDN
  2. DLE extension configured in iQ with identified lookup variables
  3. utag.js fetches DLE objects based on lookup variables to enrich on-page data layer


How dle extension works_v2 (1).jpg

Use Case - Enriching Product Data

Let's take a look at a simpe use case to illustrate how data layer enrichment works.

You have a database of information for the products you sell on your website. The basic product attributes, such as "ID", "Price", and "Name", are readily available to your web application and are currently populated in the data layer on your page. However, in an offline system that is not available to your web application are several additional product attributes that you want to put into your on-page data layer, such as "SKU", "In Store Availability", "Free Shipping Status", and "Brand", etc. 

Step 1 - Identify Lookup Variables

The on-page data layer contains product_id, which is also an identifier in the offline data, so this is a good candidate for a lookup variable.

Step 2 - Create/Upload DLE Objects

A program will be created to export the offline product data into JSON data files, named according to the expected values of product_id. For example, if the on-page data layer contains product_id=["PRD123"] , then a matching DLE file named "PRD123.js" will be created. A separate file is created for every product (value of product_id).

Step 3 - Configure DLE Extension

With the lookup variable identified and DLE objects uploaded, the DLE extension can be added and configured to use product_id.


Now, let's see how it works in action. Your on-page data layer might only have "product_id" available, but you've used the DLE API to upload additional product data. The lookup variable will be product_id which means the values of that variable (the product identifiers) will determine the names of the DLE objects. 

On-Page Data Layer


    "page_type"  : "product",
    "product_id" : ["PRD123"]

DLE Object


    "has_free_shipping"  : ["0"],
    "has_instore_pickup" : ["1"]

Enriched Data Layer


    "page_type"          : "product",
"product_id" : ["PRD123"]
"has_free_shipping" : ["0"], "has_instore_pickup" : ["1"] }