【问题标题】:Facebook Conversion API - not receiving eventsFacebook Conversion API - 不接收事件
【发布时间】:2021-05-24 02:11:25
【问题描述】:

我正在服务器上实现 Facebook Conversion API 以捕获通过不同站点上的购物车完成的销售。我使用 cURL 从 PHP 代码调用 FB API。这是我的有效载荷:

[    
   {
          "event_name":"Purchase",
          "event_time":1621701565,
          "event_id":1621701565,
          "action_source":"website",
          "event_source_url":"https://www.example.com",
          "user_data":{
             "em":"f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a",
             "fn":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25",
             "ln":"9e7cd9cb5a63a3591e16f4d835f32a1c4a84ab66e39ae27aa448c03b66bf63e7",
             "client_user_agent":"Chrome",
             "client_ip_address":"1.2.3.4"
          },
          "custom_data":{
             "currency":"USD",
             "value":"20.00",
             "content_ids":"PQ001"
          }    
    } 
]

当我提交它时,我会收到这个回复:

{"events_received":1,"messages":[],"fbtrace_id":"A9n8IBhVwl5gZTB4CCvSG7q"}

但是,当我在事件管理器中查看我的像素时,我没有看到该事件。我尝试使用 test_event_code 参数 - 同样的故事。有没有人遇到过这样的问题?看起来一切都已提交,但事件在哪里?

【问题讨论】:

  • 这里有同样的问题
  • 你找到问题了吗?我有类似的问题。
  • 同样的问题,有解决办法吗?

标签: facebook facebook-graph-api


【解决方案1】:

在使用虚拟用户代理值和 IP 地址时,我遇到了完全相同的问题。事实证明,您的有效载荷中的用户数据需要包含“真实”数据。

在您的示例中,问题可能是您的 client_user_agent 字段中的 Chrome 值。

尝试使用真正的client_user_agent 值(如下所示)。

这个有效载荷对我有用:

{
  "data": [
    {
      "event_name": "TestEvent",
      "event_time": 1627574182,
      "action_source": "email",
      "user_data": {
        "em": "f660ab912ec121d1b1e928a0bb4bc61b15f5ad44d5efdc4e1c92a25e99b8e44a",
        "client_ip_address": "254.254.254.254",
        "client_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0"
      }
    }
  ],
  "test_event_code": "TEST43514"
}

注意:您需要更新 test_event_codeevent_time 字段(因为 Conversions API 只接受过去 7 天内发送的事件)

感谢Matěj's answer on the Facebook Developers Community forums 提供了一个有效的示例有效负载以及 Facebook 神秘地忽略了带有虚拟数据的测试请求的见解

【讨论】:

    猜你喜欢
    • 2022-10-09
    • 2021-07-20
    • 1970-01-01
    • 2021-09-29
    • 2019-06-04
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 2022-01-20
    相关资源
    最近更新 更多