How to specify the SC variables to be tracked in an onclick event

aswathi
Rookie Contributor
aswathi

I have done in the following way:

$(selector).on('click', function() {
b.prop53 = ‘prop53 value’;
s.tl(window, 'o', b.prop53);
});

pev2 value is showing in the SC image request network tag, but the prop53 variable is not populating.

 

1 REPLY 1
Highlighted

How to specify the SC variables to be tracked in an onclick event

Tealium Employee
Hi @aswathi,
It looks to me that the b object is out of "runtime" scope - i.e. b does not exist when the click handler fires. Try to change the reference to utag.data.prop53 instead - assuming that the variable prop53 is present there. If this does not get you on the right track, post a link to the page where you are trying to get it to work and I'll take a look for you.
Kind regards,
Kevin