Attempting to update UDO values from jQuery onHandler extension

MRubens
Visitor
MRubens

Good evening! I'm attempting to update UDO values from a jQuery onHandler extension triggered on a "change" event. The extension is doing it's job and setting the values within the extension, but it's not updating any of the UDO variaibles. It's quite possible I'm simply appraching this incorrectly. I'm new to the system and struggling to get my sea-legs (so-to-type). Continued below screenshots...

Screenshot.png

Screenshot-2.png

My high level goal here is to manipulate the values saved to these variables; i.e. hash the email, etc. But without these variables updating, I'm at a loss.

I have also attempted leveraging the Set Data Values extension to set these variables in cunjunction with the jQuery extension. In this set-up I, on change, set the tealium custom event to a value which I evaluate for from a condition set in the Set Data Values extension. Same result. 

I've reviewed the order of operations and from what I can tell I should be able to achieve this. But I'm clearly missing something.

Any advice would be welcome.

Regards!

 

6 REPLIES 6

Attempting to update UDO values from jQuery onHandler extension

GavinAttard
Occasional Contributor
GavinAttard Occasional Contributor

HI @MRubens 

I think, if i got this right, you are almost there. 

So the on handler is creating a utag.link event, where-in for that event those variables are updated in the datalayer as opposed to the UDO. 

UDO = data objects created through the hardcoded implementation

datalayer = a more fluid version fo the udo, it reads the UDO objects and you can add, change or manipulate values retrieved from the UDO usign the extentions. 

UDO feeds the data layer.

When a utag.link fires, the extentions re-run and create a verions of the datalayer for the utag.link. 

So if for example you want to hash the email, you can do this using the crypto extention witha condition set to run if the variable is populated for example, and so on...

Hope that helps. 

Research your Experience | Improve and Evolve | Leave no one behind
Highlighted

Attempting to update UDO values from jQuery onHandler extension

MRubens
Visitor
MRubens

Hi, @GavinAttard. Thank you for taking a look at this.

Just so I understand correctly:


@GavinAttard wrote:

When a utag.link fires, the extentions re-run and create a verions of the datalayer for the utag.link. 


So, this "updated" version of the dataLayer where utag.link saves it's values to, wouldn't that be utag.data? Or is this another object? And if so, what is it's name? I'm interested from a QA perspective. This would allow me to check and see if these values are in fact getting set.

Following the logic you've spelled out I would leave the onHandler extension set the way it is; and then, in the extension where I create/save a duplicate variaible for hashing purposes, I'd set the following condition?

Screenshot (1).png

Again, from a QA perspective, if I'm not seeing this extension fire, then I'd like to be able to confirm that "form_email" has a value. Where should I be looking to observe this if not utag.data?

Attempting to update UDO values from jQuery onHandler extension

Community Manager
Community Manager

@MRubens Adding to what @GavinAttard mentioned about how your jQuery extension is configured to fire the tracking call utag.link(). The jQuery extension offers 3 options for the "action" it should take, set using the "Tracking Event" drop-down:

  • view - Call utag.view(), passing the variables defined in the extension directly to the tracking call.
  • link - Call utag.link(), passing the variables defined in the extension directly to the tracking call.
  • Custom - write your own JavaScript to do what you want (i.e. not necessarily fire a tracking call).

It sounds like you want option #3, in which you could update the values within utag.data but not necessarily trigger a tracking call.

Remember to "Accept as Solution" when your question has been answered and to give kudos to helpful replies.

Attempting to update UDO values from jQuery onHandler extension

MRubens
Visitor
MRubens

Hii @TealiumJustin, thank you for jumping in.

I've followed your advice and swiched to a "custom" event and am now seeing my UDO variables updare - Thank you!

Question about how I've coded this...I've simply updated the variables as such...

Screenshot (1).png

...and this seems to be working just fine. But I'm wondering if I should be adding conditions for each input so that these variables are only updating when $(this) changes. Is what I have too broad an approach (from a Tealium perspective) or am I fine leaving as is? 

Regards!

 

Attempting to update UDO values from jQuery onHandler extension

MRubens
Visitor
MRubens

So, It seems I'm left with one outstanding issue related to this exercise. While I've updated the jQuery onHandler extension to:

Screenshot (1).png

...and all of the values defined here are getting set. 

The Crypto extension I have established and set to run "After Tags" is not actually hashing my UDO variaible of form_email_hash. I'm cerain this is an order of operations issue. So, I guess my follow-up question is, how do I ensure, or is it even possible, to trigger this extension onChange of the value of form_email_hash, or some subsiquent event like my form submit event on which I have a utag.link event firing?

Thanks in advance.

Attempting to update UDO values from jQuery onHandler extension

GavinAttard
Occasional Contributor
GavinAttard Occasional Contributor

HI @MRubens 

The reason the hash will not happen is that with the custom option, you are updating the datalayer once the form actions happen. 

However this is ot trggering a 're-run' if you will, of the exentions. 

The form actions done by the user will have most likely happened well after the extentions all ran. 

If you want to use the custom you will need to include the crypto api call in the custom code, or go back to generating a .link and then you can use the extention. 

 

 

Research your Experience | Improve and Evolve | Leave no one behind