- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
11-17-2014 09:42 AM - last edited on 12-29-2015 04:11 PM by kathleen_jo
Sync vs Async makes perfect sense in the world of multipage sites, but how does it play out in a Single Page App (ajax type stuff) site?
Can I reload utag.sync.js during each view of the single page app? Or am I better rigging up something using the traditional utag.js?
Solved! Go to Solution.
11-17-2014 11:48 AM - last edited on 08-06-2016 09:35 AM by kathleen_jo
Generally speaking, we recommend using the utag.view() and utag.link() functions for anything to do with AJAX content (https://community.tealiumiq.com/t5/Tealium-iQ/AJAX-Tracking-in-Tealium/ta-p/14034).
The utag.sync.js file is meant to be a container for synchronous code, but it's not our best practice as loading resources synchronously brings the risk of page load failure. However, if you have something specific you're trying to accomplish, I'd recommend contacting your Tealium account manager.
11-17-2014 01:42 PM - last edited on 12-29-2015 04:13 PM by kathleen_jo
Additionally, you most certainly wouldn't want to reload utag.sync.js, because it is likely to contain document.write statements, which would be catastrophic for a single page AJAX app - the page would most likely be wiped out completely by the document.write calls. utag.sync.js should only be implemented once per page, and in the head only. (I'm assuming this is a true single page app with no "reload" between page views).
Hope this helps.
Copyright All Rights Reserved © 2008-2023