messaging_referrals Webhook Event Reference

This callback will occur when the user already has a thread with the bot and user comes to the thread from:

For tracking referrals in new threads, refer to Postback Event.

To start receiving these events you need to subscribe to messaging_referrals in the webhook settings for your app.

Example for m.me:

{
  "sender":{
    "id":"<PSID>"
  },
  "recipient":{
    "id":"<PAGE_ID>"
  },
  "timestamp":1458692752478,
  "referral": {
    "ref": <REF_DATA_PASSED_IN_M.ME_PARAM>,
    "source": "SHORTLINK",
    "type": "OPEN_THREAD",
  }
}

Example for Ad Referral:

{
  "sender":{
    "id":"<PSID>"
  },
  "recipient":{
    "id":"<PAGE_ID>
"
  },
  "timestamp":1458692752478,
  "referral": {
    "ref": <REF_DATA_IF_SPECIFIED_IN_THE_AD>,
    "ad_id": <ID_OF_THE_AD>,
    "source": "ADS",
    "type": "OPEN_THREAD",
  }
}

Example for Parametric Messenger Code

{
  "sender":{
    "id":"<PSID>"
  },
  "recipient":{
    "id":"<PAGE_ID>"
  },
  "timestamp":1458692752478,
  "referral": {
    "ref": <REF_DATA_PASSED_IN_CODE>,
    "source": "MESSENGER_CODE",
    "type": "OPEN_THREAD",
  }
}

Example for new thread via Discover tab:

{
  "sender":{
    "id":"<PSID>"
  },
  "recipient":{
    "id":"<PAGE_ID>
"
  },
  "timestamp":1458692752478,
  "referral": {
    "source": "DISCOVER_TAB",
    "type": "OPEN_THREAD",
  }
}

Properties

sender

PropertyTypeDescription

id

String

The PSID of the user that triggered the webhook event.

recipient

PropertyTypeDescription

id

String

Your Page ID.

referral

PropertyTypeDescription

source

String

The source of the referral. Supported values:

  • MESSENGER_CODE
  • DISCOVER_TAB
  • ADS
  • SHORTLINK

type

String

The referral type. Currently supports OPEN_THREAD.