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:

What is Data Layer Enrichment?

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. 

How It Works

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.

Same Origin Policy

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 to a page on, 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:

  • AudienceStream – You need an active AudienceStream account with visit and visitor attributes defined. If you do not have an AudienceStream account, contact your account manager.
  • Data Layer Enrichment enabled in iQ – Contact your account manager to enable your account to take advantage of Data Layer Enrichment.
  • Tealium Collect tag – You need to add the Tealium Collect tag to your Tealium iQ profile.
  • Latest version of utag.js – You need utag.js version 4.27 or later.
    Learn how to update your utag.js version.

Enabling 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:

  1. In Tealium iQ, click Save/Publish.
  2. Click Configure Publish Settings... in the upper-right of the modal.
  3. On the General Publishing tab, scroll to the bottom of the Implementation section.
  4. Select the appropriate Data Layer Enrichment Profile.
  5. Click Apply and continue to save and publish your changes to the Prod environment.

Adding and Configuring the Tealium Collect Tag

For detailed instructions see the Tealium Collect Tag Setup Guide.  WhiteUI_DataLayerEnrichment_TealiumCollectTagConfiguration.png

Data Enrichment Frequency

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:

  • None
    • Default.
    • Data layer enrichment does not occur.
  • Infrequent
    • Data layer enrichment occurs once per visit (session).
    • The retrieved customer data is stored in local storage for use on subsequent tracking calls during the session. 
  • Frequent
    • Recommended.
    • Data layer enrichment occurs on every tracking call, which allows for customer data that changes during the session to be reflected in real-time in the UDO.

      This option causes an additional HTTP request per page.

Selecting a Load Rule 

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.

Using AudienceStream Attributes in Tealium iQ 

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. 


Which AudienceStream attribute types are imported?

Not all data types are imported into your iQ account. The following data types are imported and made available in iQ:

  • Badges
  • Numbers
  • Strings
  • Booleans
  • Dates 

Building Load Rules

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.

  • is badge assigned
    True if the badge attribute is assigned to the visitor.
  • is badge not assigned
    False if the badge attribute is not assigned to the visitor.

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.

Callback Function

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...

Data Layer Enrichment Object

The data object returned in the callback has the following properties that correspond back to the AudienceStream attributes:

DLE Property Description

Object containing key/value pairs for each audience the user is in, where the key is ACCOUNT_PROFILE_ID and the value is the name of the audience.


audiences: {
    "tealium_main_208" : "Mobile User",
"tealium_main_209" : "DV Attendee"

Object containing key/value pairs for each badge assigned to the user, where the key is BADGE-ID and the value is true.


badges: {
    30: true,
    128: true,
    323: true

Visit Attributes
Object containing all the relevant visit-scoped attributes.


current_visit: {
    dates: { ... },
    flags: { ... }, // boolean attributes
    metrics: { ... }, // number attributes
    properties: { ... }, // string attributes
    property_sets: { ... } // set of string attributes

Object containing key/value pairs where the key is the attribute ID of the data attribute or an audience ID in the form of audience_account_profile_id_count_ts and the value is a Unix timestamp.


dates: {
    9356: 1491233145706,
    audience_tealium_main_103_count_ts: 1532722471000


Object containing key/value pairs for each Boolean attribute, where the key is BOOLEAN-ID and the value is true or false.


flags: {
    530: true,
    6128: false

Arrays of Booleans

Object containing key/value pairs, where the key is BOOLEAN-ID and the value is an array of Booleans (true or false).


flag_lists: {
    620: [true, false, false],
    718: [false, true]


Object containing key/value pairs for each number attribute, where the key is the attribute ID and the value is numeric.


"metrics": {
"5388": 132,
"5390": 113,
"5482": 1,
"5492": 104,
"5500": 1

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_lists: {
432: [15, 248],
519: [61, 47, 962],
674: [9, 16, 21, 53]

Object containing sub-object representing tally attributes where the keys are the ID of the attribute and the value is an object with the contents of the tally.


metric_sets: {
    57: {
        Chrome: 2470,
        Firefox: 9,
        Safari: 10

Object containing key/value pairs where the keys are the IDs of string attributes and the values are the stored values.


properties: {
    9921"United States",

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.


property_lists: {
954: ["North American", "EMEA"],
973: ["Email", "Customer ID", "Phone"]

Sets of Strings
Object containing key/value pairs where the key is the ID of the attribute and the value is an array of the stored unique values.


property_sets: {
    7604: ["Social", "Display", "DMP", "CRM"],
    7606: ["Personalization", "Analytics", "Email"]