Facebook机器人分析事件记录 [英] Facebook bot analytics event logging

查看:133
本文介绍了Facebook机器人分析事件记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发Messenger机器人,并尝试使用Facebook的应用分析平台记录其他事件.

I am currently working on a messenger bot and am trying to log additional events using facebook's app analytics platform.

相关文档:

  • Events for messenger bots
  • Activities endpoint documentation

示例请求(经过审查的应用信息):

Example request (app information censored):

curl -F 'event=CUSTOM_APP_EVENTS' \
 -F 'custom_events=[{"_app_user_id": "1", "_eventName": "my-test-event"}]' \
 -F 'advertiser_tracking_enabled=0' \
 -F 'application_tracking_enabled=0' \
 -F 'extinfo=["mb1"]' \
 -F 'page_id=xxx' \
 -F 'page_scoped_user_id=xxx' \
 -F 'access_token=xxx' \
 https://graph.facebook.com/xxx/activities

问题:

发出上述请求时,该事件将出现在我的分析概述(https://www.facebook.com/analytics/xxx/?section=AppEvents)中,但未记录实际事件.接收到的事件数量保持为零,事件调试器将不显示任何活动.

When issuing the request above, the event will appear on my analytics overview (https://www.facebook.com/analytics/xxx/?section=AppEvents) but without the actual event being recorded. The amount of events received stays at zero and the event debugger won't show any activity.

如果我发送的事件没有访问令牌(与上述请求相同,只是没有令牌),则事件将得到正确处理.

If I send the event without an access token (same request as above, just without the token) the event will get processed correctly.

虽然我可以使它以这种方式工作,但我真的认为发布没有访问令牌的事件根本不应该工作..是否不能所有人都将它们发布到我的应用程序中吗?

While I can get it to work this way, I really don't think posting events without an access token should be working at all.. couldn't just everybody post them for my application?

该应用程序当前仍处于沙箱模式,因此问题可能与此有关.有人有经验吗?

The application is currently still in sandbox mode, so the issue might be related to that. Does anybody have experience with that?

快速Facebook本身似乎正在使用访问令牌发送请求,如

Quick edit: Facebook themselves appear to be sending the request using an access token as seen int he facebook sdk for android.

推荐答案

编写事件受到您识别有效appId,pageId,页面范围用户ID三元组的能力的限制-无法提供任何保护.我认为应该删除访问令牌-您可以使用它读取事件数据,但不能写入事件数据.

Writing the events is limited by your ability to identify a valid appId, pageId, page scope user id triplet - no protection is afforded. I think drop the access token - you can use it to read event data but not write it.

page_scoped_user_id必须是Facebook页面范围内的用户ID,并且page_id同样有效.您是否在测试中使用了无效的?这可能就是为什么他们没有全部通过的原因.

The page_scoped_user_id must be a Facebook page scoped user id and the page_id similarly valid. Are you using invalid ones as part of testing? That might be why they don't all get through.

这篇关于Facebook机器人分析事件记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆