If I have a page with many text links and button links, and I want to connect one trackevent (A CustomEvent that will send a signal to a Facebook pixel) to ALL of them i.e. The SAME custom event will fire whenever any link or button on the page is clicked......
....Do I have to attache the trackevent code snippet to every element individually??
....Or can I have one 'OnClick' - kind of snippet that will work for all the links / buttons in that page?
If possible could you please tell me the exact bit of code, and the exact steps,please?
Thank you very much in advance!
Naresh
Hi Naresh!
What you probably want to do is to write an individual and separated function that will do whatever you like (in this case signal to facebook) and call this function from every button\event that you need to.
function callFacebook (event , $w){ //... your condition and what you want the function to do } export function button1_click(event, $w){ callFacebook; //whatever the button does }
Thats a general direction to what you should do.
If you want an expert to help you coding\design your site, you can always take a look at the Wix Arena.
Best of luck!
Doron. :)