Tealium Technical Integration Guide
Tealium Technical Integration Guide
Tealium Technical Integration Guide
Integration
Guide
Version
1.7
Table
of
Contents
Introduction
...........................................................................................................................
3
Tealium
Universal
Tag
............................................................................................................
4
Asynchronous
vs.
Synchronous
........................................................................................................
4
Tealium
Universal
Data
Object
...............................................................................................
5
Technical
Guidelines
.........................................................................................................................
5
Example
Code
..................................................................................................................................
5
Best
Practices
...................................................................................................................................
6
Page
Specific
Data
................................................................................................................................
6
Product
Arrays
.....................................................................................................................................
6
Array
Alignment
...................................................................................................................................
7
Event
Tracking
........................................................................................................................
7
Page
View
Tracking
..........................................................................................................................
7
Event
Tracking
..................................................................................................................................
8
Full
Example
Page
Code
..........................................................................................................
8
Introduction
Tealium is the leader in enterprise tag management, a new class of application that
enables digital marketers to more easily deploy their mission-critical online solutions,
while also providing a hub for managing and exchanging digital data.
This document provides instructions on integrating the Tealium Universal Tag (utag)
and the Universal Data Object (UDO) with your website. Included are guidelines for
placing the Tealium code snippet on your pages, best practices for implementing a
Universal Data Object, and advanced features for dynamic tracking.
NOTE: You can find the code snippet specific to your account and profile in Tealium iQ
under Admin Menu > Code Center.
Technical
Guidelines
When developing your UDO variables, there are certain guidelines to follow to avoid
errors or inconsistencies in your implementation and to conform to JavaScript and
Tealium standards.
1. No Spaces: Do not add spaces between the words of a variables name,
instead use the underscore character ('_').
2. Double Quotations: Make sure values for a variable are surrounded by
double quotes. If a value contains double-quotes be sure to escape them with
a backslash eg. utag_data.page_name = "On Sale: \"Red Hot\" Deals!";
3. No Extra Code: Do not add code to the Universal Data Object script block. If
that additional code fails then the UDO may not be parsed correctly, which
can interfere with the proper execution of the Tealium tag.
4. Properly Format Arrays: When a variable contains more than one value,
format the values into an array. Each element of the array must be
surrounded by its own set of double quotes. Make sure the collection of
values in the array are surrounded by square brackets.
Example
Code
The following serves as an sample UDO as it would appear on your page. This
particular example shows variables that might appear on a "Shopping Cart" page.
<script type="text/javascript">
var utag_data={
"country_code"
: "US",
"currency_code"
: "USD",
"page_name"
: "Cart: View Shopping Bag",
"page_type"
: "cart",
"product_id"
: ["PROD123", "PROD456"],
"product_name"
: ["Red Shoes", "Black Socks"],
"product_category"
: ["Footwear", "Apparel"],
"product_quantity"
: ["1", "2"],
"product_unit_price" : ["65.00", "4.75"],
"cart_total_items"
: "3",
"cart_subtotal"
: "74.00"
};
</script>
The UDO can be updated with additional values outside of the declaration block, just be
sure that all data has been set prior to loading utag.js.
<script type="text/javascript">
utag_data["page_name"] = "View Cart";
</script>
Best
Practices
Page
Specific
Data
When populating the Universal Data Object, only include the variables pertinent to that
page type. This reduces clutter in your page code. Below is an example of a search
page UDO. Notice that it does not contain product or order variables.
<script type="text/javascript">
var utag_data={
"page_name"
: "Search Results",
"page_type"
: "search",
"search_results" : "42",
"search_keyword" : "tennis shoes"
};
</script>
Product
Arrays
Array Alignment
All product array variables should have the same number of elements to ensure data
alignment. In this example, notice that the first element of each array corresponds to the
first product. Data associated with "Product 1", such as the ID, the price, and the
quantity, each appears as the first element in each array.
Event
Tracking
While the base Tealium Universal Tag will automatically track standard page views,
there is often the need to track dynamic events. Dynamic events can include anything
that occurs after the page has loaded, such as click tracking, video interactions, or
AJAX functionality.
The Tealium Universal Tag exposes two Javasript functions that allow a website to
manually trigger a page view or a dynamic tracking event: utag.view() and utag.link().
Each function takes one parameter--a Javascript data object (similar to utag_data).
Typically used for AJAX page flows where the URL does not refresh as the user
navigates the site.
The UDO declared on the initial page load (utag_data) is not re-purposed with
these calls. You must explicitly pass a data object to this function.
The Universal Tag automatically triggers this function on every page load.
Example:
utag.view({
"page_type" : "checkout",
"page_name" : "Checkout: Select Payment Method"
});
Event
Tracking
utag.link()
Example:
utag.link({
"event_type"
"product_id"
"product_quantity"
"product_unit_price"
});
:
:
:
:
"cart_add",
["PROD123"],
["2"],
["12.99"]