Magento 1.9 – Implement Facebook Pixel addToCart with Ajax

facebookfrontendmagento-1.9

I implement the facebook pixel code on my magento store in the head section. I use this code snippet from github:
https://gist.github.com/rafaelstz/4dcaecae4318eb552b48

This snippet not works with my "add to cart" because I use Ajax. How I can trigger "fbq('track', 'AddToCart');" with ajax requests?

Best Answer

there is probably a js function that you call when adding a product to the cart.
You can add at the end of that function: fbq('track', 'AddToCart');

Related Topic