• 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

Viewing 1 replies (of 1 total)
  • Thread Starter roddeo

    (@roddeo)

    Hi Tomi – apologies, one other issue I have just noticed. For variable products the ecomm_prodid variable seems to grab the group id rather than the individual variation id. This is causing another matching issue with the FB catalogue which is organised by variation id. Is there another product id in the DataLayer or is it possible to add one that pulls the variation id?

    Thanks

    Roddy

Viewing 1 replies (of 1 total)
  • The topic ‘Formatting issue with multiple product id’s – facebook pixel “AddToCart” event’ is closed to new replies.