Jump to content

Facebook audience pixel


Jani_T

Recommended Posts

Hello guys,

 

I am new for prestashop and I am trying to set up my FB audience pixel to track addToCart event. But it does not work. This is how my event tarcking code looks like and it is located in the product.tpl

 

This is the button:
 
<p id="add_to_cart" class="buttons_bottom_block no-print">
<button type="submit" name="Submit" class="btn btn-default blue_btn button">
<span>{if $content_only && (isset($product->customization_required) && $product->customization_required)}{l s='Customize'}{else}{l s='Add to cart'}{/if}</span>
</button>
</p>
 
And this is the event tracking code after it.
 
<script type="text/javascript">
 {literal}
 $('#add_to_cart').click(function() {
   fbq('track', 'AddToCart', {
     content_ids: ['{$product->id}'],
     content_type: 'product'
   });  
 });
 {/literal}
</script>
 
Could some body please help me and tell what am I doing wrong?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...