- TLC Home Home
- Discussions & Ideas Discussions & Ideas
- Product Guides Product Guides
- Knowledge Base Knowledge Base
- Developer Docs Developer Docs
- Education Education
- Blog TLC Blog
- Support Desk Support Desk
Use the Domain-Based Deployment extension to load a QA or Dev version of the Universal Tag (utag.js) based on the hostname. This is typically used for validation purposes when you have the Prod instance of utag.js loading on your QA or Dev sites.
See the full list of available extensions.
In this article:
The Domain-Based Deployment extension loads a QA or Dev version of the Universal Tag (utag.js) based on hostname (the JavaScript window variable location.hostname
). When utag.js
loads in the page, the Domain-Based extension is executed immediately and checks the current hostname for matches to any of your declared environments. If there's a match, the appropriate environment version of utag.js is loaded.
Once the extension is added, the following configuration options are available:
dev.tealium.com
.qa.tealium.com
.Your production website contains the following script:
<script type="text/javascript"> (function(a,b,c,d){ a='https://tags.tiqcdn.com/utag/my_account/main/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).
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).The following examples shows the utag.js
files that would load for this example:
<script type="text/javascript"> (function(a,b,c,d){ a='https://tags.tiqcdn.com/utag/my_account/main/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>
<script type="text/javascript"> (function(a,b,c,d){ a='https://tags.tiqcdn.com/utag/my_account/main/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
loads first and then /dev/utag.js
or /qa/utag.js
. Any subsequent utag.#.js
files that load are served from the respective Dev or QA environment.
Copyright All Rights Reserved © 2008-2021