- TLC Home Home
- Discussions & Ideas Discussions & Ideas
- Product Guides Product Guides
- Knowledge Base Knowledge Base
- Developer Docs Developer Docs
- Education Education
- Blog Blog
- Support Desk Support Desk
Data Layer Enrichment makes AudienceStream visit and visitor attributes available in your Tealium iQ configuration and populates that data in your data layer.
In this article:
Data Layer Enrichment imports your AudienceStream attributes into your Tealium iQ account and makes them available as part of your data layer. The customer data collected in AudienceStream is populated in the data layer on your website. Those attributes can then be used in load rules, extensions, and tags in your iQ account to create personalized experiences for your customers.
Data Layer Enrichment is a profile-level setting in iQ that links to a corresponding AudienceStream profile. After Data Layer Enrichment is enabled, a new type of data layer variable called AudienceStream Attribute appears in the list of variables on the Data Layer screen. The visit and visitor attributes from the AudienceStream profile are imported and become available to use just like any other data layer variable.
These attributes are populated with real-time customer data into the Universal Data Object (UDO) using the Tealium Collect Tag.
Upon a visitor's first visit to your site, the Tealium Collect tag sends a call to AudienceStream to retrieve the most recent visitor profile attributes. The data is placed in the browser's local storage for future use.
On the second tracking call, the AudienceStream attributes are now in your UDO and affect any load rules, extensions, or tags that are configured with them.
Because tags load asynchronously, the most recently retrieved set of attributes are available for use on subsequent tracking calls, rather than on the current page's events.
It's important to note that the browser mechanism used to store customer data, localStorage, adheres to the same origin policy for security purposes. This means that data layer enrichment does not persist across http protocols or subdomains.
For example, when going from a page on www.tealium.com to a page on secure.tealium.com, the data layer enrichment data stored in localStorage does not persist to the new subdomain. Therefore, when a user changes subdomains or protocols, a new data layer enrichment call must be made to re-populate localStorage and the data may not be available until the subsequent tracking call.
These are the requirements for using data layer enrichment:
To enable data layer enrichment, you must select an AudienceStream profile from which to import the attributes. By default, Tealium iQ loads attributes from the main AudienceStream profile, but an alternative profile can be set in the Publish Configuration area of iQ.
To set the AudienceStream profile used for data layer enrichment:
For detailed instructions see the Tealium Collect Tag Setup Guide.
To set up your Tealium Collect tag to enable Data Layer Enrichment, you must determine how often to update your data layer with attribute information. Here are the options:
This option causes an additional HTTP request per page.
We recommend leaving the default Load on All Pages load rule selected for the Tealium Collect tag. To make your data layer as rich and robust as possible, you need to populate it with the most relevant data as soon as you can.
AudienceStream attributes are treated as imported variables in Tealium iQ. This means you cannot edit or delete them from Tealium iQ. If you want to delete or modify an AudienceStream attribute, you must do so from your AudienceStream profile. Moreover, you cannot import attributes to a profile library, only to a regular profile.
Not all data types are imported into your iQ account. The following data types are imported and made available in iQ:
You can use the attributes to create your load rules. The following two rule operators are available to accommodate the use of badges in load rules.
Deleting an attribute from AudienceStream automatically removes it from the data layer screen in iQ as well. However, load rules that use a deleted attribute do not automatically remove it from their logic. You must manually update load rules that still reference deleted AudienceStream attributes.
The data layer enrichment request provides a callback mechanism so that you can execute code based on the response of the data layer enrichment request. The callback method is named window.tealium_enrichment()
.
To use the callback function, create a JavaScript Code extension scoped to Pre Loader with the following code example:
window.tealium_enrichment = function(data) {
console.log("Data Layer Enrichment Callback");
// Your code here...
};
The data object returned in the callback has the following properties that correspond back to the AudienceStream attributes:
DLE Property | Description |
---|---|
audiences |
Audiences Example: audiences: { |
badges |
Badges Example: badges: { |
current_visit |
Visit Attributes Example: current_visit: { |
dates |
Dates Example: dates: { |
flags
|
Booleans Example: flags: { |
flag_lists |
Arrays of Booleans Object containing key/value pairs, where the key is Example: flag_lists: {
|
metrics |
Numbers Object containing key/value pairs for each number attribute, where the key is the attribute ID and the value is numeric. Example: "metrics": { |
metric_lists |
Arrays of Numbers Object containing key/value pairs for each number attribute, where the key is the attribute ID and the value is an array of numeric values.
|
metric_sets |
Tallies Example: metric_sets: { |
properties |
Strings Example: properties: { |
property_lists |
Arrays of Strings Object containing key/value pairs for each string attribute, where the key is the attribute ID and the value is an array of strings. Example: property_lists: { |
property_sets |
Sets of Strings Example: property_sets: { |
Copyright All Rights Reserved © 2008-2022