requirejs and Tealium IQ

Tealium Expert
Tealium Expert

Got a question from one of our developers; If we should start to use requirejs as a loader for javascript, how would that impact utag.js? Should we expect problems of some kind? Is it recommended to load utag.js from within requirejs even?


Anyone has tried this framework with Tealium IQ?

Per L


requirejs and Tealium IQ

Employee Emeritus

Hello @per_lundqvist. You can search around our community board for angularjs as it is a similar concept to requiresjs.


I have not personally used requiresjs, but I have a feeling these are the pitfalls you want to avoid:


1) Do not call utag.js before utag_data is populated.

2) If you need to call utag.js before utag_data is populated, turn off the Tealium initial page view by putting the following code in an extension scoped to Pre Loader:


2a) Then call utag.view after you have all the page data.

3) In an "old school" website, utag.js would load on each page and would call the initial page view which then sends data from utag_data to your tagging vendors.

3b) Now in the single page world, you have to define when you want to have "page views" and call Tealium's utag.view to simulate a page view.

3c) Do not try to call utag.view until after the utag.js has full loaded.

4) Do not try to recycle utag_data or when calling utag.view.  Build up a JSON object and pass that to utag.view


There might be others, but those are the first ideas that come to mind.



requirejs and Tealium IQ

Tealium Expert
Tealium Expert

Thanks @brian_kranson. Helps a lot.