- 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
This guide explains how to manage data layer variables.
This article contains the following sections:
The Data Layer screen offers several ways to manage the variables in your data layer. Each variable that you implemented on your website must also be created here so that it can be used in your configuration. In addition to the dynamic data you populate in your site's Universal Data Object (UDO), a number of other built-in variables from your pages are available to be added from this screen.
Learn more about the built-in variables available in the UDO.
If you're unsure about what data might be available from a web page on which Tealium is installed, use the Universal Tag Monitor to quickly see what data is being collected.
Learn More: An Introduction to the Data Layer
The data layer screen organizes variables by type. The types are based on where the data for the variables comes from. The supported types are:
This type is for variables defined in your Universal Data Object, also referred to as utag_data
, which you can find in the code for your webpage. Most of your variables will be this type.
In the page: var utag_data = { language : "en", currency : "usd" };
Name in iQ: language
and currency
Reference this variable with JavaScript in an extension: b["language"]
Select this type to reference a JavaScript variable on your web page (other than the utag_data object). Normal syntax rules apply to the JavaScript variable type.
In the page: var myApp = { page : { name : "Home Page" } };
Variable name in iQ: myApp.page.name
Reference this variable with JavaScript in an extension: b["js_page.myApp.page.name"]
Select this type to capture parameters from the URL. The query string consists of everything after the "?" character in the URL.
In the URL: http://example.com/path/file.html?sortOrder=price
Variable name in iQ: sortOrder
Reference this variable with JavaScript in an extension: b["qp.sortOrder"]
Select this variable type to reference the value in a cookie being set on your domain. When creating a cookie variable you can either specify the Tealium cookie, utag_main
, or a standard cookie. The examples below describe both methods.
The following table describes the set of default parameters stored in the Tealium cookie, which are available in the Tealium data bundle.
Cookie Parameter | Description | Version of utag.js |
---|---|---|
_st |
This is a number unique to the current page view. | 4.011 and later |
ses_id |
This is the timestamp to log the time spent by a visitor on your site. | 4.011 and later |
_ss |
This is a flag value (0 or 1) indicating the start of session. | 4.26 and later |
v_id |
This id value is unique to the visitor. | 4.26 and later |
_pn |
This is the page number (_pn ) value which starts over at 1 with each new session and increments every time utag.js loads. |
4.27 and later |
_sn |
This is the session count. | 4.27 and later |
To store data in the Tealium utag_main cookie, prefix the variable name with "utag_main_". For example, if you want to track affiliate referrals with a cookie named "aff" and you want to store this value inside the Tealium cookie, name it "utag_main_aff".
Reference this variable with JavaScript in an extension: b["cp.utag_main_aff"]
To store data in a non-Tealium cookie, create a new Variable called "aff" with a type of cookie value. You can set the cookie value using the Persist Data Value extension.
Reference this variable with JavaScript in an extension: b["cp.aff"]
Understanding when to use each type of cookie is important when trying to save cookie space. We recommend that you use the Tealium cookie as much as possible. However, if you're using the Split Segmentation extension, then you must use a non-Tealium cookie.
For more information on how to use cookies with Tealium, please see the Tealium Cookies article.
Select this type to reference the content of a meta tag in the page.
In the page: <meta name="author" content="Tealium" />
Variable name in iQ: author
Reference this variable with JavaScript in an extension: b["meta.author"]
These are built-in DOM variables that cannot be modified. They are set automatically in the page.
Learn more about built-in utag.js variables.
This section describes how to add single variables or import bulk variables.
Use the following steps to add a single variable:
If intended for use in AudienceDB, column names for variables may contain any ASCII characters other than double quotes.
If intended for use in EventDB, column names for variables must consist of only UTF-8 printable characters. ASCII characters in standard and delimited identifiers are case-insensitive and are folded to lower case. For additional details, see Amazon Web Services - Names and identifiers.
Adding variables individually can take some time. Tealium iQ provides an easy way to add numerous variables at the same time with the Bulk Import from CSV option.
Use the following steps to add variables using the Bulk Import from CSV option:
Source, Type, Description (optional), Alias (optional)
Checking the Replace All Variables box will remove the all of the current variables and replace them with the variables you enter in the text field.
Data Bundles are the easiest way to quickly build your data layer based on the most commonly used variable names and Tealium's best practices. The variables are grouped into bundles that are organized by their typical use. There are Standard Bundles ranging across a variety of uses from E-Commerce to Mobile Apps and Provider Bundles from services such as as Demandware and WordPress.
The E-Commerce bundle will automatically add and configure the E-Commerce extension.
Use the following steps to access variable bundle types:
The following list provides a summary of the Common Variables dialog:
Use the following steps to import a bundle:
Adding a bundle will not overwrite your existing data layer variables.
When you expand the variable summary to show the details, a list of the dependencies displays. The dependencies make it easy to see which tags, load rules, and extensions are referencing this variable. This is also where you can edit or delete a single variable. In addition, you can apply new labels or manage any existing labels.
Clicking the Edit All button launches the following dialog, from which you can make changes to any and all variables.
You cannot delete variables from the "Edit All Variables" screen.
Copyright All Rights Reserved © 2008-2022