Highlighted

Re-evaluate extension

Silver Contributor
Silver Contributor

Hello,
we are looking for a way to re-evaluate every extension after the page call a specific javascript function.

We would like in this way to pass new value to a lookup table in order to get the new mapped value.

Is there a method in the utag library that could let me re-run all the extensions?

Thank You,
Claudio.

4 REPLIES 4
Highlighted

Re-evaluate extension

Employee Emeritus

The only way to re-evaluate the extensions is to either call utag.view or utag.link.  More information on these functions can be found in this article: https://community.tealiumiq.com/t5/Developers/utag-link-and-utag-view/m-p/75/highlight/true

 

The passed in data object will then run through all extensions and the appropriate tag(s) will fire.

Highlighted

Re-evaluate extension

Tealium Employee

Hi Claudio,

Depends on the extension scope I guess. JavaScript code copy pasted inside extensions and scoped to all tags / specific tags are by default wrapped in an anonymous function scope, i.e. not possible to trigger them without calling utag.view / link. However, if you define your in page data layer modification functions in a pre-loader / dom ready scope, and make them referenceable (named functions) then you can trigger them at will. I assume you are planning on overloading an in page function?

If you really want to take the creative hat on, you could try run all tags scoped extensions (your lookup table extension) without firing tags, by passing in a dummy value to utag.track directly:

utag.track("claudio", { "data_source_name_trigger" : "new value to consider" });

By calling utag.track with a custom value as first argument, no Tealium IQ tag templates will know about "claudio" event, unless you have explicitly modified a profile template to react to the "claudio" event type.

Not knowing your exact challenge you are dealing with here, but perhaps your day-to-day SE can help you with iterating over it with you. Please note that extensions are designed to run in conjunction with what is supposed to be considered a page view and / or click data ultimately triggering tag technologies to fire.

Highlighted

Re-evaluate extension

Silver Contributor
Silver Contributor

Hi Kevin,
calling the function utag.track('claudio' ,.....) work well and it re-run all extension without sending any tag, but it seems that all the lookup table (All tag scoped) work is not modifing the global utag.data variable but only a local version (the b variable) that is passed correctly modified to all the tags.

I have created a new custom tag that work only with my custom event flag "claudio" that copy the b object into the global utag.data variable.
In this way after i run the utag.track i go and read the utag.data to extract the new mapped value from my lookup table.

Do you think this the "correct" way to do that.

Thank you very much,
Claudio.

Highlighted

Re-evaluate extension

Tealium Employee

I forgot to tell you that the passed object will become reality for that particular call. That is why you only see your changes to 'b'.

So instead of doing all of the above (you can of course do that if you need to be able to do more "house cleaning" on utag.data when "claudio" event is happening) but you could just update the utag.data object with the new pre-condition for your lookup table extension and then call utag.track with utag.data as argument. I think that would do it, without the need for your custom container tag merging data from 'b' onto utag.data.

For example:

utag.data.my_data_source = "something else";
utag.track("claudio", utag.data);

Both flavors should work, though I would not recommend doing too much of this stuff so please be careful. In an ideal world when pre-conditions to the page change, pass in a new fresh object every time and do not reuse previous data from the sticky utag.data object on the page. In a very heavy ajax environment, it makes it very hard to maintain. The data object (UDO) data sources, at least the vital ones like page_name, page_type, product_ids etc, should be provided and maintained by the developers of the website, not built and maintained inside Tealium.