Facebook Pixel Events

This article is for users who want to upgrade to the facebook pixel events from at least v2.2.0.. 

  1. Go to the theme editor (read this article for more info)
  2. Choose /assets/js_scripts.min.js and completely replace the file with the contents of the following file: https://pastebin.com/raw/ph2JH9h7
  3. Choose  /assets/js_product.js and search for line 270:

    $productPrice.html( theme.Currency.formatMoney(variant.price, window.shop_money_format) );
    	

    Right after this line, add the following line:

    $productPrice.attr('data-price', ( variant.price / 100 ) );
    	
  4. Choose /sections/product-page.liquid and look at the first line:
    <article id="product-page" class="loading{% if collection == blank %} move-top{% endif %}" itemscope itemtype="//schema.org/Product" data-collection="{{ collection.handle }}">
    	

    Replace it with the following line:

    <article id="product-page" class="loading{% if collection == blank %} move-top{% endif %}" itemscope itemtype="//schema.org/Product" data-collection="{{ collection.handle }}" data-id="{{ product.id }}">
    	
  5. Save all files and you're done!