3

I am looking at my project page load improvement and I do see both utag.js and utag.sync.js loaded.

Does utag and utag.sync.js both javascript files needed for tealium integration.

If both are needed then why ? what is the purpose, difference between these two js?

Thanks, Sri

Sri
  • 1,205
  • 2
  • 21
  • 52

1 Answers1

5

utag.js and utag.sync.js are there for slightly different reasons. Essentially, utag.js will be needed as this is the main JavaScript file that Tealium generates. It's generally responsible for looking after your Data Layer, evaluating load rules, running extensions, loading/executing your tags, etc. All that sweet, sweet Tealium iQ functionality comes from there.

With all this in mind, the utag.js file is pretty big. So, in order to not slow down the page load, Tealium recommends that you load utag.js asynchronously in the <body> (see here).

However, there are a few situations where your vendor code needs to be run at the very beginning of the page load. Examples of this include any A/B testing tags (Optimizely, Adobe Target, etc.) or occasionally some content-changing tags require being loaded early in order to flickering.

For these situations, Tealium provides utag.sync.js—that's a separate file from utag.js that you can load synchronously in the <head>. You can then paste the code from any of these tags that require very early loading, in order to be sure that they will be loaded in time. You can read more about how to use utag.sync.js here.

But yes, long story short: utag.js is the main Tealium JS file, responsible for the main functionality. utag.sync.js is then an additional file used for certain situations/bits of code that wouldn't work as required if implemented in utag.js.

Sam Conran
  • 156
  • 1
  • 7