The example code given by FB for ViewContent
pixel code does not work when copied and pasted using their parameters into my product page.
If I put ANY parameters in the ViewContent
function pixel call other than track
& viewContent
, ALL parameters are ignored and the pixel does not fire; the only way I can get the pixel to fire is provide NONE OF MY PARAMETERS at all, then FB complains that certain parameters are missing.
The liquid code variables are properly initialized from prior code; ie, liquid code is populating OK into .js parameters for source code for web page.
I have tried ALL combinations of double quotes, single quotes, etc. around both keywords & data. The FB Pixel Helper extension installed to Chrome shows, when viewing web page source code, only:
fbq('track', 'ViewContent');
(even though I have provided parameters as shown below) thereby ignoring and leaving my parameters shown below out. If I do not code these parameters, and code only the line above, then the ViewContent event fires, but of course FB complains about lack of content_type and content_ids, etc.
My code:
<!-- DPWCo-eCOMMERCE Mod JSON Tags for FB Catalog generation per Product from FB Pixel -->
<script>
fbq('track', 'ViewContent', {
content_type: 'product_group',
content_ids: [{{my_product_variant_ids_string}}],
content_name: '{{product.name}}',
content_category: '{{my_productcollections_ids_string}}',
description: "{{product.description | auto_link | paragraphs}}",
url: "{{product.full_url}}",
image: "{{product.photo.url_400}}",
brand: '{{store.name}}',
value: {{product.price}},
currency: 'USD',
itemCondition: 'new',
availability: 'in stock'
});
</script>
<!-- end of DPWCo-eCOMMERCE Mod JSON Tags for FB Catalog generation from FB Pixel -->