Search code examples
facebookfacebook-messengerfacebook-chatbot

differentiate between message came from facebook and facebook Chat Plugin


i'm using Messenger Chat Plugin from facebook in my website , my problem is i can not differentiate between messages came from facebook and messages from the plugin in my site web ?

is there a way to make a difference between those messages ?

Messenger plugin from the site web :

enter image description here


Solution

  • The documentation of the plugin explains how you can differentiate these messages from others, https://developers.facebook.com/docs/messenger-platform/discovery/customer-chat-plugin#detect

    Detecting Message Origin

    At times, it may be necessary to determine whether a user is engaging with your business using the customer chat plugin. To enable this, the Messenger Platform will include a "source": "customer_chat_plugin" property inside the message payload for all messages sent from the plugin


    You can also use the ref parameter to pass in more detailed information, if needed, like the page the plugin was embedded on, or a reference to a specific user account on your site.