Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Error : x-fb-cd-contents : ['contents'] must be an array." #20

Open
baptiste74 opened this issue Aug 23, 2021 · 2 comments
Open

Error : x-fb-cd-contents : ['contents'] must be an array." #20

baptiste74 opened this issue Aug 23, 2021 · 2 comments

Comments

@baptiste74
Copy link

I try to send custom_data "contents" via x-fb-cd-contents parameter via InitiateChekout and Purchase but I get a 200 error on server side debug mode :

{"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_subcode":2804019,"is_transient":false,"error_user_title":"Server Side Api Parameter Error","error_user_msg":"The parameter $['data'][0]['custom_data']['contents'] must be an array.","fbtrace_id":"Ack-e18nn4DSE933xa9Xv2_"}}

BUT, those parameters are well sent through client side tag :

Parameters: (4)
contents:
[{"id":"1234567890","name":"Boucles doreilles ROMY","item_price":35,"quantity":1}]
value:
35
currency:
EUR
content_type:
product

It seems that the parameter x-fb-cd-contents doesn't match the "contents" parameter or is unable to sent it correctly.

Grateful for any ideas, many thanks.

@koconnor3
Copy link

koconnor3 commented Aug 23, 2021 via email

@baptiste74
Copy link
Author

Yes I am using GA4 tag.

I tried the "items" parameter rather than the "x-fb-cd-contents" parameter and it worked !
I just changed some parameters in the array and everything matches perfectly --> https://prnt.sc/1qhpoih

Thank a lot for you help.

facebook-github-bot pushed a commit that referenced this issue Apr 20, 2023
Summary: Fix x-fb-cd-contents array receiving [object Object] from web container

Differential Revision: D44755084

fbshipit-source-id: 25b458a563b3e23a14c1f5a108dea770744dc67a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants