Reload / re-evaluate load rules

Gold Contributor
Gold Contributor
I'm implementing a consent solution for one of our costomers. Due to the current law we cannot load anything until a user gives his consent on the website. Tealium though is initized and the utag.js is loaded (nothing else will load until the proper consent level is set). I would like to 'reload' re evaulate all loadrules and launch other tags when someone clicks the accept button. (I'm running the latest version of the loader template) Now i'm triggering utag.view(); when someone accepts consent. I would expect Utag.view(); to rerun utag.js and re-evaluate all the load rules and launch tags if they meet the loadrules. This does not seem to work. So now i've got a temp solution callin utag view with this syntax: utag.view({},null,[2]); But in the future more taggs will be added and this method wont be managable (for each new tag we have to ajust this extension). Is there a solution for this problem?
8 REPLIES 8

Reload / re-evaluate load rules

Employee Emeritus
Marcel, Your expectations are correct. The utag.view function will re-evaluate load rules and load in tags that didn't load on page load. You shouldn't need to define a specific tag number like "[2]" for this to work. One thing to keep in mind is that calling "utag.view()" will not send any data. The data sent in the utag.view function is independent of any data on page load. This means that utag.view will not send any of the data that was sent on page load. You will need to send that data once again within the utag.view function like so: utag.view({page_name:"sample page",page_type:"sample type"}) The reason it works when you define the tag UID is because this bypasses all Load Rules. The conditions do not have to be met in the Load Rules when you define the UID. This is the assumption Tealium makes when you specify a tag UID. I would suggest checking the data that gets sent when you call utag.view and make sure the data needed for the load rules is defined and sent in the utag.view function.

Reload / re-evaluate load rules

Gold Contributor
Gold Contributor
Hi Jared, Thanks for the Quick response. I understand that the page data has to be sent again, but I would also expect: Loading the page: - utag.js is loaded Click accept coocies: utag.view(); is called Now I would expect for example utag.2.js to load after the utag.view So when I understand things correctly I should include all information in my datalayer in the utag.view(); to launch the utag.2.js and other tags after clicking on accept.

Reload / re-evaluate load rules

Employee Emeritus
"So when I understand things correctly I should include all information in my datalayer" If you want the utag.view to trigger the exact same data as the initial page load then yes, you would include all the information from the data layer. In this situation you can do something like this: utag.view(utag_data); NOTE: Including all data like the above is not recommended in most cases. However, it sounds like that is what is needed here.

Reload / re-evaluate load rules

Bronze Contributor
Bronze Contributor

@jared_hislop wrote:
The utag.view function will re-evaluate load rules and load in tags that didn't load on page load.[...]

Hi Jared,

just few years late it seems. I don't understand the quoted statement. I have a tag - all pages that's loaded on page load. When i call utag.view() due to cookie-privacy law acceptance, this tag is also reloaded. There's a way to run it once?
I found only ways to run once the utag.view or to just launch/reload a specific tag, but not a all-but-one tag solution.

Thanks

Reload / re-evaluate load rules

Tealium Employee

Luca

The qoute 'The utag.view function will re-evaluate load rules and load in tags that didn't load on page load.[...]' is saying that a tags whose 'load rule' did not resolve true on the first page load,  if a subsiquesnt utag.view has a UDO value that meets the condition of the this tag's load rule, then it will load.  ( along with any other tag whose's load rule resolves true ) If a tag's load rule is 'load on all pages then it will send on *any* utag.view since utag.view is considered an event for a  synthetic page load.

If you want to only load a tag on on the actual hard loading of a page,  then one way would be to scope a javascript extension that creates a window object or variable.  Then use this object in the condition that 'if not defined'.  Then the tag will load the first time, create the window object,  then any other utag.view it would be stopped since the variable is defined and created on the first page load.  The javascript window object or variable will be cleared on any hard page load and the tag will only load on actual page-loads and not on single page app page changes and subsiquent utag.views.  

Hope this helps.

Robert

 

Reload / re-evaluate load rules

Bronze Contributor
Bronze Contributor
Thank you Robert,
i was thinking about something like that but i wasn't sure. So Load Rules checks happen before extensions (Tag scoped) occur?
My tag is a Tealium Generic Tag and i have a Tag Scoped extension that sets a couple of UDO variables used as @@dynamic_values@@ in the query string. Can i use one of those as "not defined" Load Rule or better go with a window.variable? In this last case i suppose it should be After Load Rule scoped, right?

Reload / re-evaluate load rules

Tealium Employee

luca

Correct,  only preloader or extensions scoped to 'all tags' with 'before load rules' checked run before load rule are evaluated. 

Extension scoped to a tag setting UDO variable will only persist in the 'b' object ( a copy for the UDO for that tag is passed in as a parameter in the scoped extensions ) and will not be in the utag_data window object at the end of the loading of the tag and running of scoped extension.  Of course there are other ways to handle instead of a window object/flag but this way comes to mind first.

Also,  instead of using a Generic tag to load a script - you can coordinate a custom container temaplate to only load the script on the first page load and not use the u.send part of the template ( u.send is what is going to be triggered on the 'next utag.view' ) not all the template code runs on both the page load's automatic page view then compared to the second utag.view call.  This may be advanced and you should probably consider running this through a support ticket for help if it's your first time coding a custom container.  ( having an engineer with experience running you through the code or providing a sample template may prove invaluable. ) 

 

Robert

Reload / re-evaluate load rules

Bronze Contributor
Bronze Contributor
Thank you very much Robert!
Public