Back
 

Overview

 

This exercise will walk you through the basic Load Rules configuration for TealiumDemo.com sandbox accounts. To complete this exercise you will need a sandbox provisioned for you by your Channel Enablement Manager, after which you’ll have access to Tealium IQ, as well as the URL to access the sandbox site.

 

Load Rules are conditions that control the firing of tags. For a review of all the aspects in the Load Rules tab, see: https://community.tealiumiq.com/t5/User-Documentation/Load-Rules-Tab/ta-p/5098

 

 

 

 

Strategy #1 – Page Type

 

The first thing will want to do is use the data source: page_type to tell us where we are in the site. A common first thought is to leverage the URL, but that leaves you dependent on the site maintainer keeping the same structure forever, or at least notifying you of changes (which we all know will never happen). We want to instead use something that is much more reliable (or should be, see the exercises on Tealium Verify product to combat issues with this), and that is the Data Layer. The backend team, or the CMS/eComm platform itself, is responsible for maintaining the UDO (Universal Data Layer) which is part of the Data Layer construct (see lessons on Data Layer Strategy for more on this), and so it lives in parallel to any changes they make.

 

We’ll start off with mapping out the Main sections of our site so that we can start targeting tags right away in our Tagging exercises. To do this we’ll leverage the Web Companion tool to view what the values should be. Remember that this assumes the UDO has been deployed, otherwise you’d essentially be dictating to Development what the values should be. The Web Companion is accessed through the Tealium Tools Chrome Extension or our Bookmarklet for other browsers.

 

 



The first thing will want to do is use the data source: page_type to tell us where we are in the site. A common first thought is to leverage the URL, but that leaves you dependent on the site maintainer keeping the same structure forever, or at least notifying you of changes (which we all know will never happen). We want to instead use something that is much more reliable (or should be, see the exercises on Tealium Verify product to combat issues with this), and that is the Data Layer. The backend team, or the CMS/eComm platform itself, is responsible for maintaining the UDO (Universal Data Layer) which is part of the Data Layer construct (see lessons on Data Layer Strategy for more on this), and so it lives in parallel to any changes they make.

 

We’ll start off with mapping out the Main sections of our site so that we can start targeting tags right away in our Tagging exercises. To do this we’ll leverage the Web Companion tool to view what the values should be. Remember that this assumes the UDO has been deployed, otherwise you’d essentially be dictating to Development what the values should be. The Web Companion is accessed through the Tealium Tools Chrome Extension or our Bookmarklet for other browsers.

 

  image02.png
     
  • Open your Sandbox site
  • Open Web Companion
  • Open the Data tab
  • Choose Universal Data Object
  • Scroll to the value for page_type
  • Copy the value (on the right) within the quotes
   image04.png

 

 

Keep a list of the values in a scratchpad, and repeat for the following areas: Homepage, Shop, T-Shirts, Shoes, <Any> Product page Blog, <Any> Blog Post, Image Gallery, Timeline, Contact, Cart, Checkout. Also keep track of the URL’s associated with each page.

 

 

 

 

 

 

You should have something that looks like this spreadsheet: https://docs.google.com/spreadsheets/d/1CtZoMOivJxXOmqNFOvQEt3VYTGw4SDedD1dUrS4GsE8/edit#gid=0

 

image06.png

 

 

You’ll see that some of these page_type values are unique, so usable for our targeting purposes, for the other’s we’ll need more complex rules. Let's start with the easy ones. Back in Tealium IQ, click on the Load Rules tab and the green Add Load Rules button. Set the values appropriately, like below, using page_type, equals, and the page_type value. Repeat for Homepage, Product, Blog, and Blog Post.

 

image09.png

 

 

 

You should now have 5 new Load Rules

 

image05.png

 

 

 


 

 

 

Strategy #2 – Page Type + Post Title

 

Since we have several site sections without Load Rules for targeting, because the page_type value is not unique, we need to look at the rest of the Data Layer to see if there is anything else that we can use in combination with the page_type value to determine which section we are in. You can use the Web Companion tool to view the rest of the data, or you can open up the Console inside your Developers Tools panel in the browser, and type utag.data in the command area then press enter and expand the Object shown. I recommend clearing the console before running the code first. You can also do View Page Source of the page, and then search for var utag_data = { … }  but you’ll see it will be missing some data, since it is only the site-exposed data sources (aka, UDO).

 

If you visit all of the pages with a page_type value of page, then you see one common data source with a unique value, and is expressed by the site platform, is post_title. Look at the sheet s2 now on the supporting document, and check out the values for each. Setup new Load Rules that use page_type equals page AND post_title equals (ignore case) ____.

 

Note that since there is variability in the values letter casing, we chose the Ignore Case option. Repeat for each of the green rows.

 

image08.png

 

 

 

Hint use the Copy button after creating the first and change values to save time. You now have 5 more Load Rules:

 

image03.png

 

 


 

 

Strategy #3 – Page Type + Pathname

 

Most sections are accounted for, but we don’t have post_title values for the archive page_types. Right now the only differentiator here is the URL, so let's use the Pathname value (this is the part of the URL after the Domain Name and TLD (.com/.net/etc), starting with the first forward-slash, and ending at the end of the URL or the first question mark (?) or hash (#) symbol… whichever comes first. Look at sheet s3 on the supporting document for these values.

 

Use the built-in pathname data source under the DOM Elements section in the dropdown. We are also making sure that the page_type value is archive, so that we are sure to exclude other scenarios if they exist.

 

image01.png

 

 

Repeat for the rows highlighted in orange and you should the last 3:

 

image00.png

 

There is just one problem now. We have T-Shirts and Shoes mapped explicitly, but now we’d have to map all the others, which is tedious. Not only tedious, but what happens in the future when new categories are added? Generally Category pages are tagged as a whole, and only seldom individual category pages by themselves. So let's create a generic Category rule by modifying (let's Copy first, and then modify) the Shoes Load Rule. Since there is a common root folder in the pathname value, we can switch from equals to contains, or even better: starts with. This way as long as the same hierarchy is followed in the platform the category page is covered.

 

image07.png

 

 


 

 

Save and Publish

At this point we have most of the site mapped. We’ll create some other targets later, but for now Save and Publish to Dev/QA. We are now able to target tags to specific area’s in our next exercise: Tagging lv 1.