This post will give insight into when to use Tealium's Custom Container vs. Tealium's Pixel Container vs. Tealium's Generic Tag

Before You Begin

These resources are available to use if a specific vendor is not currently added to the Tag Marketplace. It is always a best practice to use a pre-built tag from the marketplace before attempting to use one of these general tag options. If you are not sure what tag corresponds to the code you received from a vendor, please reach out to your Account Manager and a Tealium representative will be able to assist. 

Which Tag to Use?

The complexity of the tag is what determines which tag to use. Typically the Pixel Container and Generic Tag are used for more simple image requests or for loading an external JavaScript File. For more complicated tags that may use multiple external JavaScript files or callback functions, the Custom Container will be needed. In this post we will look at a couple different code snippets from vendors to determine which tag to use. 

Before we start it is good to note that the Tealium Pixel Container, for the most part, has been replaced with the Tealium Generic Tag.

The main differences between the two being: 

  • The Generic Tag allows you to load a single vendor.
  • The Pixel Container allows you to load up to eight different pixels in the same tag.
  • The Generic Tag allows you to load an external JavaScript File, Pixel Container does not
  • The Generic tag also allows for the use of mappings, which makes the tag more like standard tags. Adding dynamic values to the Pixel Container is a bit more tricky. 

Here are deeper looks into the three resources: 

Tealium Pixel Container: https://community.tealiumiq.com/t5/Tags-and-Client-side/Tealium-Pixel-Container-Tag/ta-p/13388

Tealium Generic Tag: https://community.tealiumiq.com/t5/Tags-and-Client-side/Tealium-s-Generic-Tag/ta-p/12034

Tealium Custom Container: https://community.tealiumiq.com/t5/Tealium-iQ/Tealium-Custom-Container/ta-p/14015

Let's take a look at when to use each instance. 

Tealium Pixel Container

Here is a sample vendor pixel:

<img src="http://www.example.com/trackingpixel.gif?orderid=<Replace with OrderID>" width="1" height="1" border="0" alt="" />

This is a simple image request. You can see the "img" at the beginning of the script block that indicates this is an image request. In this case we need to do very little other then simply load this image on the page. 

See link above for information on setting up this image request using the Pixel Container

Tealium Generic Tag

Here is a slightly more complicated vendor pixel. This is similar to what you'd see directly from the vendor. 

<script language=""javascript"" type=""text/javascript""><
var RndNum4NoCash = Math.round(Math.random() * 1000000000);
var ar_Tail='unknown';
if (document.referrer) ar_Tail = escape(document.referrer);
</script>

<img src=""http://ad.vendor.ru/cgi-bin/rle.cgi?' + 'sid=187991&sz=home&bt=21&pz=0&rnd=' + RndNum4NoCash + '&tail256=' + ar_Tail + '"" border=0 width=1 height=1>

Notice this has a couple of extra parameters attached to the image. 

Using the above img request we can pick out 5 variables in the query string and a base URL:

  • rnd  = Math.round(Math.random() * 1000000000);
  • tail256 = “unknown” or document.referrer
  • sid  =  194705
  • bt = 21
  • pz=0
  • Base URL = /ad.vendor.ru/cgi-bin/rle.cgi

This is a good example of using the Tealium Generic Tag. We can use Extensions to create the data sources for "rnd" and "tail256." Then, using the mapping section, map those data sources back to the tag. We can also use the Static Parameters section of the Generic Tag to set the remaining data points: "sid", "bt" and "pz." 

See the Link above for detailed instructions to set up this vendor using the Generic Tag

Tealium Custom Container

The Tealium Custom Container is used when you need to load an external JavaScript File, but also need to call a function after that file has loaded. 

Here is a sample request that has an external JS file and a callback function that needs to be triggered after the JS file has loaded:

<script type="text/javascript" src=(('https:' == document.location.protocol ? 'https://' : 'http://') + 'd3aa0ztdn3oibi.cloudfront.net/javascripts/ff.loyalty.widget.js')></script>

<!-- Put this script tag anywhere in body. -->
<script type="text/javascript">_ffLoyalty.displaySurpriseWidget("aynl6Rnvyx");</script>

In this case you would want to use the Tealium Custom Container because you can control the order of operations. The template for the Custom Container will load the JS File first then call the callback function immediately after. 

NOTE: Using this Tag requires you to modify the Tag template and is only recommended for advanced users. See additional warnings and guidelines here.

See the link above for detailed instructions to set up a vendor using the Tealium Custom Container.