Formatting issue with multiple product id’s – facebook pixel “AddToCart” event
-
Hi Tomi – I’m wondering if you can help me out with a Datalayer related query to do with Facebook.
I set up a new variable to pass my product id’s (eccom_prodid) to my Facebook tags for events such as AddToCart; Purchase etc. Everything works fine if there is only one product id in the cart but as soon as there is more than 1 I get a “can’t match products” error in the FB pixel checker. When I looked into the issue further in FB business manager they are flagging a formatting issue as follows:
When multiple product id’s are passed in the tag the format being passed to FB looks like this:
[“16566,20113”]
Facebook is asking for the following format with each individual id wrapped in single quotes:
[‘16566′,’20113’]
Is there a way to format the ecomm_prodid in the Datalayer as outlined by FB or set up an alternative version that is formatted as above? Alternatively is there a way to achieve the same thing by formatting the variable in GTM?
Appreciate any steer you can provide.
Kind Regards, Roddy
- The topic ‘Formatting issue with multiple product id’s – facebook pixel “AddToCart” event’ is closed to new replies.