javascript - Facebook Pixel ignoring 'AddToCart' event in click function -
i adding facebook pixel track events online shop. reason following code gives error on facebook's chrome extension:
the code used pretty simple:
$(document).ready(function() { $('.add_to_cart_button').click(function() { fbq('track', 'addtocart', { content_ids: [ '56404', '48061', '56412' ], content_type: 'product', value: 48, currency: 'eur' }); }); });
when click event removed facebook chrome extension tracks 'addtocart' event ideally added on click of 'add cart' button not on load of page otherwise guess end incorrect data.
should ignore error or leave without click event?
Comments
Post a Comment