I'm trying to start implementing some dynamic marketing on Facebook. To do this, I need to use the Facebook Pixels to track users behaviors.
<script>
fbq('track', 'ViewContent', {
content_ids: ['1234'],
content_type: 'product'
value: 0.50,
currency: 'USD'
});
</script>
The issue I have is having this code update with each different product. I was able to update the code (below) using EE tags to get the data I need, but to do so, I have to place the Facebook pixel code inside the EE {exp: loop. When doing this, Facebook doesn't recognize the pixel code. If I leave it outside of the {exp: loop, the EE tags don't work.
Updated code:
<script>
fbq('track', 'ViewContent', {
content_ids: ['{product_item_id}'],
content_type: 'product'
value: '{price}',
currency: 'USD'
});
</script>
Has anyone else had this issue with ExpressionEngine and Facebook Pixels? I'm running EE 2.8.1, Expresso Store 2.5.