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:

enter image description here

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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -