Fire Data Values extension

Bronze Contributor
Bronze Contributor

?1) Newbie here: I'm trying to capture the page data layer objects, concatenate them, and send that info to the applicable udo(s).  Here's where I think I'm overthinking it.  My goal was to setup one 'set data extension' and condition it to fire with when specific jquery onclicks occur?

?2) Currently this JS code is not firing with this onclick. Where's the issue? I've tested over 10 times. Snapshot:



Fire Data Values extension

Tealium Expert
Tealium Expert

Hi @jbenavidez2,

You're referencing the object, but at the point where the event takes place that object isn't in scope.

You should only reference when using an All Tags or Tag Scoped extension that works on the current event payload.

In the case of a click handler, you're dealing with the DOM Ready creation of an event listener, so in your example you will need to manually fire a Tealium event. So instead of references to b, you should initialise your own object, and at the end of the code, emit that to Tealium, so along the lines of:

var payload = {
  event_source: "jQuery Extension"

payload["value"] = $("#amount").val();
payload["event_source_id"] = $(this).attr("id");;