從 1.6.0 版起,轉換 API 閘道開始支援 API 端點,可讓廣告商將非網頁(離線)事件從其伺服器傳送至轉換 API 閘道。這類似轉換 API 直接方法。主要差別在於事件會透過轉換 API 閘道傳輸,而不是直接將事件傳送到 Meta 圖形 API。
若要傳送新事件,請從以下路徑向此 API 的 /events 關係連線發出 POST
要求:https://<capig.instance.url>/capi/{PIXEL_ID}/events
。
當您發佈到此關係連線時,Meta 會建立新的伺服器事件。
curl -i -X POST \ -d '{ "data": [ { "event_name": "Purchase", "event_time": <Unix timestamp in seconds, must be within the last seven days>, "user_data": { "em": [ "973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b" ], "ph": [ "ce3a598687c8d2e5aa6bedad20e059b4a78cca0adad7e563b07998d5cd226b8c" ], "client_ip_address": "123.123.123.123", "client_user_agent": "CLIENT_USER_AGENT", "fbc": "fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890", "fbp": "fb.1.1558571054389.1098115397" }, "contents": [ { "id": "product123", "quantity": 1, "delivery_category": "home_delivery" } ], "custom_data": { "currency": "usd", "value": 123.45 }, "event_source_url": "http://test.com/product/123", "action_source": "website" } ] }' \ https://<capig.instance.url>/capi/<PIXEL_ID>/events