Facebook Pixel | Event Codes | Scripts on buttons

SoilentRed

Caaan do!
I'm installing Facebook Pixel on a site and I would like to trigger events on clicks rather than page loads. How do I add a snippet of javascript to a submit button?

Also, can I change my username? It was created a long time ago and references a project that no longer exists.
 
I don't know if XenForo supports changing usernames. I'll try it and see. What username do you want?

-- hugh
 
As for adding code to submits, best way is with a Fabrik event ...

Code:
requirejs(['fab/fabrik'], function () {
   Fabrik.addEvent('fabrik.form.submit.end', function (form) {
       // only need to check form.id if you might have multiple forms on a page (like form modules)
       if (form.id == '123') {
         // your code here
      }
   });
});

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top