Editing the master utag template

Tealium Expert
Tealium Expert

What are the coolest / most useful / least obvious capabilities you've unlocked by manually editing the master template for the utag.js file to get it to work in a manner other than one that was intended?

4 REPLIES 4

Editing the master utag template

Tealium Expert
Tealium Expert

For my part, all I've done was update a single line to bring the code in line with our content security policy, but now that the genie is out of the bottle and we're running on a custom template, I'm looking to rip off the inspiration of others to make it do something more interesting..

Editing the master utag template

Moderator
Moderator

Hi @UnknownJ

 

It probably won't surprise you to learn that we do not normally recommend editing the utag template, as it makes future updates much more difficult :-)

 

If you have a useful enhancement, we would love you to share it with us so that we can look at incorporating it into a future release for everyone's benefit. I cannot think of any significant benefits that you could get from editing the tag template, and the risk of breaking things is pretty high. New features of utag.js are always made available in the release notes: https://community.tealiumiq.com/t5/uTag/utag-js-version-4-40-Release-Notes/ta-p/12946

 

If you (or anyone else) have ideas for improvements or enhancements, it would be great to hear about them so that we can consider adding them to the next official release of utag.js.

 

Thanks for your highly valuable input and feedback; we really appreciate it.

 

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.

Editing the master utag template

Tealium Expert
Tealium Expert

Breaking stuff is the best way to learn how not to break stuff in future.. :o)

 

Thus far I've tampered very little (and really, all I've done is implemented #6 on the 4.40 release notes early), but I had been wondering about adding onerror handlers to pixel trackers which might set localStorage variables that can be picked up on future events by another vendor, e.g. using an analytics vendor to track both the outcomes of total load rules on the page, and the subsequent success rate per tag firing.. though from the looks of things that's an edit to the tag templates too, bit messy..

 

Then a bunch of boring stuff around debugging, extending link() and view() with custom event types, changing the behaviour of utag.data with respect to utag_data such that they behave consistently regardless of whether utag_data is created before or after utag.js runs, etc..

 

Mostly I was wondering if anybody had done anything interesting with any customisations that made life easier, notwithstanding the obvious pain that upgrades then bring...

Editing the master utag template

Moderator
Moderator
Thanks for the feedback. I agree the first point is probably a bit too messy, and beyond what most people require. If you have Tealium AudienceStream or any of the data access products, you already get data on which tags fired on a particular page, though it doesn't go down to the pixel level, just that the tag's send function completed successfully.

Regarding extending link and view, these are really just stub methods, which in turn call the more flexible utag.track method. If you call utag.track, you can pass in your own custom event type, although there is requirement to do this.

For utag_data and utag.data, there were also some enhancements around this in utag.js 4.40, and further enhancements are planned in future. Keep checking the release notes for more info.

Thanks again. I'm certainly not closing the dicussion here, as others may have more to add. Feel free to add more info to the thread in future.
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