How to correctly track button clicks in Big Cartel (with Facebook pixel)

Viewed 8

I'm stuck with setting up correctly FB pixel code, events like page view and content view work fine, but seems I missing something with tracking button clicks like "AdToCart" or "InitiateCheckout" events. Tried to play with a code, but didn't figure out it.

Here is the original code I tried to implement from Facebook for Add to Cart event.

<script>
<button id="button add-to-cart-button">AddtoCart</button>
<script type="text/javascript">
  $('#addToCartButton').click(function() {
    fbq('track', 'AddToCart', {currency: "EUR", value: {{ option.price }}});
  });
</script>

What am I doing wrong?

0 Answers
Related