utag.sync.js timeout if the server does not respond

Silver Contributor
Silver Contributor

Hi all,

since utag.sync.js is a synchronous javascript, one of our customers asked us a way to better manage it's implementation.
Is there a way to set a timeout to manage the case where the server hosting the utag.sync does not respond? In this way the page load would not be blocked and the page could keep loading normally.

Thanks in advance

1 REPLY 1

utag.sync.js timeout if the server does not respond

Moderator
Moderator

Hi @luca_pezzoli,

Unfortunately this isn't possible. By their nature, once synchronous scripts have been requested, they cannot be stopped. JavaScript is single-threaded, which means that there is no way to have another process running to "observe" the synchronous request and abort it if it doesn't complete. This is why we recommend using our fully asynchronous approach wherever possible.

Thanks,

Craig.

Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Public