2016-11-20 16 views
0

我正在爲我的客戶之一,它需要跟蹤用戶誰添加項目購物車,並沒有購買它.. 該網站使用BigCommerce,所以添加到購物車是在頁面上動態執行而不移動到下一頁。Facebook AddTOCart像素沒有引發點擊事件

這裏是AddtoCart

<div class="form-action"> 
 
    <input id="form-action-addToCart" data-wait-message="Adding to cart…" class="button button--primary" type="submit" value="Add to Cart"> 
 
</div>

而對於Facebook像素代碼:


 

 
<!-- Add Pixel Events to the button's click handler --> 
 

 
<script type="text/javascript"> 
 
     $('#form-action-addToCart').click(function() { 
 
     fbq('track', 'AddToCart', { 
 
      content_name: 'Really Fast Running Shoes', 
 
      content_category: 'Apparel & Accessories > Shoes', 
 
      content_ids: ['1234'], 
 
      content_type: 'product', 
 
      value: 4.99, 
 
      currency: 'USD' 
 
     }); 
 
     }); 
 
</script>

此外,試圖用$('#輸入外形行動addToCart「),但像素沒有得到解僱..我使用Facebook的官方像素Chrome擴展...

facebook pixel - addtocart error

+0

需要回答,請調查一下。 http://stackoverflow.com/questions/41036938/do-we-need-to-explyly-check-that-user-is-coming-from-facebook-or-not – VBMali

+0

我自己修復了它,無論如何謝謝 – Srinivas08

回答

0

好了,經過一番研究,終於得到它的工作..!

$("#form-action-addToCart").click(function() { 
 
};

+0

需要回答:http://stackoverflow.com/questions/41036938/do-we-need-to-explicitly-check-that-user-is-coming-from-facebook-or-not – VBMali