Answer the question
In order to leave comments, you need to log in
How to assign a pixel face book event when the "add to cart" button is clicked?
I'm not a front-end at all, but just a designer, but it became necessary to add the facebook pixel event not to the page as a whole, but to a specific "add to cart" button. The site is self-written (on Tilda), so it’s impossible to solve the issue simply with the onclick attribute. I tried my best to write an add function:
<script>
$("#rec98787508 .t750__btn t-btn t-btn_sm ").click(function(){ fbq('track', 'AddToCart', { value: 999,
currency: 'RUB',
content_ids: 'coldbloodpump',
}) });
</script>
Answer the question
In order to leave comments, you need to log in
In principle, the event works for you, what does it write in the console ??
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question