The Facebook Conversion API eventsFacebook Conversion API events are more powerful overthan the Facebook Web PixelsFacebook Web Pixels. The Conversion API event gets fired through backend logic. you can use the ajax call from the front end, and check the event triggers on the Facebook panel
Facebook Pixel Conversion API
https://developers.facebook.com/docs/marketing-api/conversions-api/
you can generate the access token from https://business.facebook.com/event_manager select your site and generate the facebook pixleFacebook pixel
javascript ajax function and you can simply call this ajax function where you want to trigger pixel
Function Call
let event_id = d.getTime(); fbq_custom("PageView", window.location.href, {event_id: 'PageView-'+event_id}, {event_id: 'PageView-'+event_id}) } Function Definition
function fbq_custom(trace = 'PageView', source_url = '', data = {}){ data.trace = trace; data.source_url = source_url $.ajax({ url: "/conversionAPI/", data: data, type: "post", success: function (data) { console.log(data); console.log("server event test"); } }); } https://github.com/facebook/facebook-php-business-sdk
PHP API