Attention! When creating pixel code not through the site settings, you must first add the main pixel code beforehand. To do this, create a block/menu with the main pixel code and place it in service tags, displayed on all pages. In this case, you do not need to specify the pixel code in the general site settings.
If the pixel code is specified in the main settings, then the Facebook Products Merchant code is already installed on the site.
Menu block for generating pixel with product data
Create a block/menu with the following code:
<script>
fbq('track', 'ViewContent', {
content_name: '{HOTENGINE-SC:shop_cat_page_title}',
content_ids: ['{HOTENGINE-SC:shop_cat_page_id}'],
content_type: 'product',
value: {HOTENGINE-SC:shop_cat_page_price},
currency: '{HOTENGINE-SC:shop_cat_page_currency_iso}'
});
</script>
Show Block/Menu on pages: Only on Store pages
Enter characters upon detection of which to display Block/Menu: htm
Enter characters upon detection of which NOT to display Block/Menu: cart
If you need to add an event after submitting a request through a Form, then after the successful data submission text, add the following code:
<script>
fbq('track', 'Purchase');
</script>