Messenger Platform

 
 
 

Send to Messenger Plug-in

When your Facebook app is in Development Mode, plugin and API functionality will only work for admins, developers and testers of the app that have a valid session. After your app is approved and public, it will work for the general public.

The "Send to Messenger" plugin is used to trigger an authentication event to your webhook. You can pass in data to know which user and transaction was tied to the authentication event, and link the user on your back-end.

The first time a person clicks on this button, a confirmation popup will be presented.

Requirements

To use the send to Messenger plug-in, you must include the Facebook for Javascript SDK in the page where the plug-in will be rendered.

For instructions on including the SDK, see the Facebook for Javascript SDK Quick Start.

Setup

<div class="fb-send-to-messenger" 
  messenger_app_id="<APP_ID>" 
  page_id="PAGE_ID" 
  data-ref="<PASS_THROUGH_PARAM>" 
  color="<blue | white>" 
  size="<standard | large | x-large>">
</div>

For a complete description of available attributes, see the send to Messenger plug-in reference.

Event Subscription

Subscribe to plugin events.

<script>

  FB.Event.subscribe('send_to_messenger', function(e) {
    // callback for events triggered by the plugin
  
  });

</script>

Event Fields

Field Name Type Description

event

Enum

Name of event. Possible values: rendered, clicked, not_you, opt_in.

ref

String

Contains the value set on the data-ref param on the plugin.

is_after_optin

Boolean

Indicates whether event happened after the confirmation pop-up was confirmed.

pluginID

undefined

This field is not used.

Callback

This triggers the opt-in callback.