The data layer is the foundation of your Tealium solution and will serve as the one true definition of your data across all digital assets and customer interactions. The data layer comprises all of the various data elements that will be collected across your site and the visitor interactions and events that will be tracked.
Universal Data Object (UDO)
The utag_data object variable should be defined and populated prior to loading the Universal Tag (utag.js).
When utag.js loads in the page it looks for the utag_data variable and uses its data to automatically trigger an page view tracking call with utag.view(). If you have a single page application, or are calling utag.view() manually, you might not need utag_data. Learn more about your page tracking options.
Use string values for all variables, including boolean and numeric data.
Enclose all values in double quotes or single quotes and escape any quotes that might appear in the value itself (eg. utag_data.page_name = 'It\'s All About the Data!';).
For boolean values use “1” and “0” to represent true and false. This is the simplest way to represent a boolean using strings.
Use strings for all dollar amounts and exclude all currency symbols and commas eg. utag_data.order_total = "1234.00"; instead of "$1,234.00".
Use array values for all product related variables. The Tealium library, and each vendor tag integration, is designed to use arrays for all product-related data (ID, price, quantity, etc.) eg. utag_data.product_id = ["P1234", "P4567", "P7890"];
Avoid Extra Code
Do not add extra code to the UDO script block. If any code in the same script block fails, the UDO may not be defined correctly which might lead to unexpected data being passed to your vendor tags.
The following is a sample UDO as it would appear on a page. This specific example shows properties that might appear on a “Shopping Cart” page with two products in the cart.
When populating the UDO, only include variables pertinent to the current page type. This reduces clutter in the page code and eliminates confusion about what data is expected. Below is an example of a search page UDO that omits unnecessary items such as product and order data.
Product variables are to be populated as arrays, even when a single product is being set. Below are examples of setting the product ID variable with one product ID (eg. on a Product Detail page) and with three product IDs (eg. on a Shopping Cart page).
All product array variables should have the same number of elements to ensure data alignment. In this example, notice that the first element in each array corresponds to the first product. Properties associated with this product (such as ID, price, and quantity) all appear in the first element in each array, while the properties of the second product will appear in the second element in each array, and so on.