I wrote a code to perform event handling using html id selector to track link click via a tealium extension. The problem I'm facing is the function is getting called multiple times and thus the collect tags for GA is getting triggered many times.Below is the code which I wrote. Can anyone figure out what is wrong with the code? document . getElementById ( 'EditcontactPage' ). addEventListener ( 'click' , clickListenerFunction );
function clickListenerFunction ()
{
var data ={
"event_parent" : "Page Tag" ,
"event_type" : "Click" ,
"event_id" : "EditcontactPage" ,
"event_value" : "http://localhost:4200/editcontact" ,
};
console . log ( "data" , data );
utag . link ( data );
}; `
... View more