Highlighted

Dynamically reloading utag.js

Rookie Contributor
I've been reading up on using utag.view(variables) whenever the UDO changes as part of an event, not sure if it's the right solution. I am looking into a scenario where we're when clicking on a navigation, the page changes dramatically, since we're essentially pulling in an entire new page, but keeps the outer template in place. We do some tricks so our customers gets the smooth transition you get when only replacing partial content, however from a Telium POV, this really is a completely new page and all rules should be evaluated again. 1. The URL is updated to a new vanity url the customer can share (I except any tags matching this rule should be executed) 2. UDO data from the new page is loaded. I'm assuming what I need is the ability to force Tealium to accept my new UDO data as well as force a re-evaluation of all rules based on the new URL Any ideas?
2 REPLIES 2
Highlighted

Dynamically reloading utag.js

Employee Emeritus

In this scenario, you would want to code a utag.view() function onto any links that perform the behavior above. As a best practice, we prefer that the utag.view() be coded directly onto the link(s) in question but a jQuery onHandler extension could also be used to initiate the behavior. FYI, as of utag.js v4.26 DOM data is refreshed and load rules are re-evaluated on utag.view calls: https://community.tealiumiq.com/t5/utag/utag-js-4-26-Release-Notes/ta-p/11907 so you will need to make sure you have updated utag.js

Highlighted

Dynamically reloading utag.js

Rookie Contributor
Thanks, I just upgraded to 4.33 just to test it out. Massive upgrade compared to previous view behavior and I can easily use it for the simple cases, however there is one problem still. Lets say I have an original UDO object utag_data1 = {'pagename':'page1','type':'frontpage'} Before the view, I prepare a new UDO utag.view({'pagename':'contact'}; The second tag I expect to be executed has one rule in it saying something like "type is not defined" This second rule will never be executed, since the type value has been set in the original UDO object for the page. Any ideas are greatly appreciated