Is it possible to load Custom JavaScript Snippet on all the pages of the website?

Bronze Contributor
Bronze Contributor
I have Javascript snippet code which I would like to place inline in the HTML pages throughout my websites. What step should I follow to place that JavaScript snippet in the HTML through tealium interface. If it is possible, please provide me the step wise instructions. Thanks in Advance!
4 REPLIES 4

Is it possible to load Custom JavaScript Snippet on all the pages of the website?

Tealium Employee
The easiest way to get custom javascript in is to create an extension for this. In the Extensions tab, you can add an Extension. This will bring up our Extension Marketplace. On the Advanced tab, you'll see an extension named "JavaScript Code". Adding this tag will give you a script editor window to paste your JavaScript code. What you need to decide is when you want this code to run. For all pages, you can select "All Pages" as the scope. If you want to delay when this code runs until the DOM is ready, you can select "Dom Ready" as the scope, and if you want this code to run before any of the Tealium code runs, you should select "Pre Loader" as the scope. All Pages is likely fine for the scope based on my guess. Giving the added extension a recognizable title, you can publish the deployment out, go to your website, launch WebCompanion and see if the extension fired successfully. If you don't have WebCompanion installed, click on your email address at the top right of the TealiumIQ interface, click the WebCompanion menu item and follow the steps to install it.

Is it possible to load Custom JavaScript Snippet on all the pages of the website?

Bronze Contributor
Bronze Contributor
Thanks for the Reply Mike. I have followed up your step but somehow the Tealium interface showing me the error in popup box. I am using the following code:
<script type="text/javascript"> // Javascript code here </script> <script type="text/javascript"> // Javascript code here </script> Actually I am using two javascript for analytics purpose. Should I write code with <script> tag or not. If not how can I put two tags in one textarea. Please do needful

Is it possible to load Custom JavaScript Snippet on all the pages of the website?

Bronze Contributor
Bronze Contributor
Please ignore my previous comment as I got this how should we include JavaScript. Now my question is that how would I know that the script is loading on the page or not?

Is it possible to load Custom JavaScript Snippet on all the pages of the website?

Employee Emeritus
Vipin, Cxense is an ad serving vendor. They usually have a JavaScript file that loads on the page and then serves an ad. To verify it is working, you can check an Inspector tool like HTTPFox, Charles, etc to see if that js file is loading or check for the ads that should be getting served. It sounds like you have copied the contents out of the JS file and into an extension. Cxense typically has an external JS file that gets loaded, which can easily be loaded via the Tealium Generic Tag. See this post for a little more information: https://community.tealiumiq.com/posts/702703 If further help is needed, I would suggest reaching out to your Account Manager and they will pull in the correct resource to assist. Thanks!
Public