Back

This article describes how to add and configure the Domain-Based Deployment extension.

In this article:

Table of Contents Placeholder

Configuring the Extension

Use this extension to load a QA or Dev version of your tag deployment from Production, based on hostname (location.hostname). This is typically used for validation purposes when you have Dev or QA sites and choose to use a production configuration (tag) on them.

Use the following steps to set up this Extension:

  1. In the left sidebar, go to IQ Tag Management > Extensions.
  2. Click + Add Extension.
  3. Click the Advanced tab.
  4. Click + Add next to Domain-Based Deployment
    DomainBased Deployment extension.jpg
  5. Under Configuration, in the Dev Domains and QA Domains fields, enter the Dev or QA domains that you use for testing.
    DomainBased Deployment Enter Domain Names.jpg
    Example: dev.tealium.comqa.tealium.com
    • Click the plus button (+) to add a new environment.
    • Click the minus button (-) to delete an environment.

Additional Details

Your production website should contain the following script:

<script type="text/javascript">
(function(a,b,c,d)
{
a='https://tags.tiqcdn.com/utag/account/profile/prod/utag.js'; 
b=document;c='script';d=b.createElement(c);d.src=a;d.type='text/java'+c;d.async=true;
a=b.getElementsByTagName(c)[0];a.parentNode.insertBefore(d,a);
}
)();</script>
  

In the example, the environment is prod (not qa or dev).

  • When this utag.js file is loaded, the domain-based extension is executed immediately and checks to ensure that the current hostname is dev.tealium.com or qa.tealium.com (or other declared environment).
  • If the hostname matches any of the declared environments, the appropriate environment is then loaded.

The following examples shows the utag.js files that would load for this example:

  • dev.tealium.com
    <script type="text/javascript">
    (function(a,b,c,d)
    {
    a='https://tags.tiqcdn.com/utag/account/profile/dev/utag.js'; 
    b=document;c='script';d=b.createElement(c);d.src=a;d.type='text/java'+c;d.async=true;
    a=b.getElementsByTagName(c)[0];a.parentNode.insertBefore(d,a);
    }
    )();</script>
      
  • qa.tealium.com
    <script type="text/javascript">
    (function(a,b,c,d)
    {
    a='https://tags.tiqcdn.com/utag/account/profile/qa/utag.js'; 
    b=document;c='script';d=b.createElement(c);d.src=a;d.type='text/java'+c;d.async=true;
    a=b.getElementsByTagName(c)[0];a.parentNode.insertBefore(d,a);
    }
    )();</script>
      

When you view the site traffic, if a non-production environment is detected, /prod/utag.js load, and then /dev/utag.js or /qa/utag.js. Any subsequent utag.#.js that loads is served from the respective Dev or QA environment.