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.

 

2 REPLIES 2

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
Highlighted

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

aswathi
Rookie Contributor
aswathi

SC onclick tag started firing after I tried using s object inside onclick and by specifying variables we want to track inside s.linkTrackVars.

 

Another problem is click tracking for Marketing tag. 

$("selector").on("click",function(){

b.c3_type = "123";

b.c3_account_id = "12345";

});

 

The same way is working for onload. Tried the utag.data.variable way. Still not working