- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
04-16-2019 08:16 PM
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...
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!
04-17-2019 01:30 AM
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.
04-17-2019 08:14 AM
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?
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?
04-17-2019 08:55 AM
@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:
It sounds like you want option #3, in which you could update the values within utag.data
but not necessarily trigger a tracking call.
04-17-2019 09:39 AM
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...
...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!
04-17-2019 10:15 AM - edited 04-17-2019 10:16 AM
So, It seems I'm left with one outstanding issue related to this exercise. While I've updated the jQuery onHandler extension to:
...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.
05-13-2019 09:43 AM - edited 05-14-2019 04:49 AM
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.
Copyright All Rights Reserved © 2008-2023