Highlighted

Tealium build version number into variable

Bronze Contributor
Bronze Contributor
Hi all, Is there a way to get the build version number and add it to a variable or data element? What I am trying to accomplish is to have the build version (and maybe environment [Dev/Staging/Prod] as well?) available to print out in console.log when a page loads for easy debugging. Is there an existing hook I can grab onto somewhere? Thanks!
3 REPLIES 3
Highlighted

Tealium build version number into variable

Tealium Employee
Hi Steve, There are two global variables you can use for this purpose: {code:javascript} window.utag.cfg.path {code} contains the full path of the utag.js file e.g. //tags.tiqcdn.com/utag/yourcompany/yourprofile/prod/utag.js or //tags.tiqcdn.com/utag/yourcompany/yourprofile/dev/utag.js {code:javascript} window.utag.cfg.v {code} contains the timestamp of the last published version, and that corresponds to the time you can see in the versions tab in the user interface. These variables can either be referenced directly in JavaScript code extensions, or you can define them in the data layer tab as "JavaScript Page Variables". 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.
Highlighted

Tealium build version number into variable

Bronze Contributor
Bronze Contributor
Thanks, your way is shorter, but I also got it via: utag.loader.wq[0].src.split('=')[1] -Steve
Highlighted

Tealium build version number into variable

Tealium Employee
Glad you found a way to do it, but if you can, I'd recommend switching to my method - your method *should* work, but mine's a little more robust and more efficient :-)
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.