I cant find in the documentation if there is any callback functionality in the conversion tracking (https://developers.facebook.com/docs/ads-for-websites/tag-api)
In order to track an event you just need to call:
window._fbq = window._fbq || [];
window._fbq.push(['track', 'FBCONVERSIONCODE', {'value':'0.00','currency':'USD'}]);
That is very similar to google analytics conversion code, only though they allow you to call a function when the ajax call finish:
ga('send', 'pageview', {
'page': '/my-new-page',
'hitCallback': function() {
alert('analytics.js done sending data');
}
});
Is there a way to achieve the same functionality with Facebook API?
No, Facebook doesn’t support it.
Yes, JavaScript supports it.
If the
fbqcall fails for some reason it will not returnundefined, so simply verify a smooth execution.