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

Issue

This Content is from Stack Overflow. Question asked by Artur Riony

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?



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?