- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
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?
Thanks
Per L
Solved! Go to Solution.
02-08-2016 01:25 PM - edited 02-08-2016 03:07 PM
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:
utag_cfg_ovrd={noview:true}
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 utag.data 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.
Bk
02-08-2016 11:26 PM - last edited on 02-09-2016 09:33 AM by kathleen_jo
Copyright All Rights Reserved © 2008-2023