Using m.me Links

m.me is a shortened URL service operated by Facebook that redirects users to a person, page, or bot in Messenger. You can use them on your website, email newsletters, and more.

When a user starts a new conversation or continues an existing conversation with your bot via an m.me link, the following message will appear in the conversation: "You have entered this conversation by following a link. We've let PAGE_NAME know you're here."

Contents

m.me Link Format

The format of the link is http://m.me/<PAGE_NAME>, where PAGE_NAME is the handle of the Facebook page the bot is linked to.

Referral Parameters

In addition to giving you a way to link to your bot, the Messenger Platform also supports the passing an arbitrary parameter via these links.

This can be used for many purposes, such as tracking different links placed in different channels, or tying a Messenger user to a session or account in an external app. You can even use it to direct the user to specific content or features available within the bot.

A m.me link with an added parameter looks like this:

http://m.me/<PAGE_NAME>?ref=<REF_PARAM>

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

Requirements

  • The referral parameter must be a string that may be up to 2,083 characters in length.

  • Your bot must have a get started button set to receive the referral parameter for new conversations.

  • The Page the bot is connected to must be published to receive the referral parameter for all users, except those that have the developer, tester, or admin role for your bot.

  • The referral parameter is supported in the Messenger web client, as well as the Messenger app for iOS and Android version 92.0 and above.

Reading the Passed Parameter

When an m.me link with a ref parameter opens Messenger to your bot, there are two possible scenarios you should be aware of:

1. First-Time Use Scenario

If you have configured a "Get Started" button for your page, we will deliver the passed ref param as part of the postback event that is normally sent when the button is tapped.

{
  "sender":{
    "id":"<PSID>"
  },
  "recipient":{
    "id":"<PAGE_ID>"
  },
  "timestamp":1458692752478,
  "postback":{
    "payload":"<USER_DEFINED_PAYLOAD>",
    "referral": {
      "ref": "ref_data_in_m_dot_me_param",
      "source": "SHORTLINK",
      "type": "OPEN_THREAD",
    }
  }
}

In the above, USER_DEFINED_PAYLOAD refers to the payload you previously configured to be sent in the postback.

The referral portion always follows this format:

"referral": {
   "ref": "ref_data_in_m_dot_me_param",
   "source": "SHORTLINK",
   "type": "OPEN_THREAD",
  }
Field Value Description

ref

The arbitrary data that was originally passed in the ref param added to the m.me link.

source

The source of this referral. For m.me links, the value of source is “SHORTLINK”. For referrals from Messenger Conversation Ads, the value of source is "ADS".

type

The identifier for the referral. For referrals coming from m.me links, it will always be "OPEN_THREAD".

2. Existing User Scenario

If the user already has a thread with your bot, when the user follows your m.me link, Messenger does not show any "Get Started" screen, it just opens the thread.

In this case, your webhook will immediately receive a messaging_referrals event. The webhook must have already subscribed to this event in order to be notified of the referral in this scenario.

The messaging_referrals webhook event follows this format:

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