为 Messenger 机器人(又名深度链接)创建自定义入口点 (link)

Create custom entry point (link) for Messenger Bots (aka Deep Linking)

在 Facebook 聊天机器人中,如果您查看 this documentation about Entry points,您会发现有一个选项:链接广告,您可以在其中识别 Bot 中的用户来自您在 Facebook 上的哪个广告。

在我的应用程序中,了解我的用户来自何处至关重要,因此我需要创建唯一的链接,这些链接最终会出现在我的 Bot 中,并带有一些额外的信息,例如唯一ID,帮我解决问题。

我的问题是我该怎么做?

目前可能无法直接执行此操作,但如果有人研究过 Facebook 向广告添加了哪些额外参数url,那么这些参数是可识别的也很有用。

此功能的 Telegram 副本称为:Deep Linking

最近添加了 Messenger 平台的一项新功能,可能会达到目的。在 m.me 链接中称为推荐。

info 1

Passing a Parameter

A m.me link with an added parameter looks like this: http://m.me/mybot?ref=myparam

The value of the ref parameter will be passed to the server via webhook.

info 2

Referral Callback

This callback will occur when an m.me link is used with a referral param and only in a case this user already has a thread with this bot (for new threads see Postback Event).

To start receiving these events you need to subscribe to messaging_referral in webhook settings of your app.

An m.me link with an added parameter looks like this: http://m.me/mybot?ref=myparam. The value of the ref parameter will be passed to the server via webhook.