Highlighted

Setting variables in external javascript files

Rookie Contributor
I've noticed a strange behavior. If I set a variable in my page code inside of <script> tags, then that variable seems to be available and is successfully inserted into SiteCatalyst variables. On the other hand if I set the same variables in an external javascript that is loaded prior to the utag code, then it doesn't show up in SiteCatalyst In either case, I can see the correct data in the utag.data object. So, it appears to be there even though it doesn't show up in the s object Is there a reason why this is happening?
1 REPLY 1
Highlighted

Setting variables in external javascript files

Tealium Employee
This does seem strange, Matthew. All I can think is that there must be a timing issue somewhere, and at the point SiteCatalyst is firing, the data is not yet available. Since this is quite a specific case, please get in touch with your account manager for assistance, or send me a private message with the link to your test site so that I can verify why this is happening. 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.