I have this code:
<script>
fbq('track', 'InitiateCheckout', {
content_ids: {{orderFormProducts}},
content_type: 'product'
});
</script>
That gives me the entire array:
content_ids: [
{
"id":"1",
"name": "product name",
"sku": "10",
"skuName": "sku name"
},
{
"id": "2",
"name": "product name",
"sku":"20",
"skuName": "sku name"
}
]
And what I need is to get only the sku
value of all objects inside that array, like so:
content_ids: ["10", "20"]
If I use {{orderFromProducts}}[0].sku
I can get the sku
value from the 0 indexed object, but I need from all objects inside the array like mentioned before, and {{orderFromProducts}}.sku
doesn't work.
Any ideas?