> For the complete documentation index, see [llms.txt](https://docs.bird.com/connectivity-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bird.com/connectivity-platform/how-to-guides/managing-meta-messenger-referrals-in-flow-builder.md).

# Managing Meta Messenger Referrals in Flow Builder

Meta [Messaging Referrals](https://developers.messagebird.com/quickstarts/facebook/referrals/) are specific **inbound**-**only** messages that are triggered once your end-user:

* Clicks on an [m.me link with a referral parameter](https://developers.facebook.com/docs/messenger-platform/discovery/m-me-links)
* Clicks on a [Facebook Messenger conversation advertisement](https://developers.facebook.com/docs/messenger-platform/discovery/ctm-ads)
* Starts or resumes a conversation thread from the [Facebook Chat Plugin](https://developers.facebook.com/docs/messenger-platform/discovery/facebook-chat-plugin)

#### Table of content <a href="#id-01g6wwb8ztdf5ax1z18repb3n7" id="id-01g6wwb8ztdf5ax1z18repb3n7"></a>

* [Before getting started](#h_01G1GESZHAHN77945R03RV1NA9)
* [Managing Messenger Referrals in Flow Builder](#01G6WV2RCYJPHBDECB8RQV4T0V)
* [Messenger Referrals Variables](#01G6X1FD6XZ0FNEQBNCJBQXDX2)
* [Messenger Referrals Developers Documentation](#01G6WW6B9WSP8F6V627JCF2CGR)

#### Before getting started <a href="#h_01g1geszhahn77945r03rv1na9" id="h_01g1geszhahn77945r03rv1na9"></a>

Before starting,  you’ll need:

* A [MessageBird account](https://dashboard.messagebird.com/)
* A Meta [Messenger channel](https://dashboard.messagebird.com/en/channels/facebook)
* [Inbox account](https://inbox.messagebird.com/) (optional)

#### Managing Messenger Referrals in Flow Builder <a href="#id-01g6wv2rcyjphbdecb8rqv4t0v" id="id-01g6wv2rcyjphbdecb8rqv4t0v"></a>

The rich automation capabilities of Flow Builder enable you to create a Flow scenario, depending on your use case, of how you want to handle these inbound messages.\
Let's say you have created a [Facebook Messenger conversation advertisement](https://developers.facebook.com/docs/messenger-platform/discovery/ctm-ads) with a *Get Started* call to action, initiating a Messenger conversation:

<figure><img src="/files/clWnvCMHNlDylWg84IhD" alt=""><figcaption></figcaption></figure>

1\) Create a new [Flow](https://dashboard.messagebird.com/en/flow-builder/create/custom), with the Facebook Messenger incoming message as the trigger:

<figure><img src="/files/JV59IPBVKNWZjKhvSYm8" alt=""><figcaption></figcaption></figure>

2\) Choose the Messenger channel you have [set up](https://dashboard.messagebird.com/en/channels) to start the Flow:

<figure><img src="/files/59omqT5sPPT2IlxZS5ee" alt=""><figcaption></figcaption></figure>

3\) Create the desired automation scenario of the Flow, be it replying to the end-users message via a customized chatbot Flow, collecting inputs into an external [Google Sheet](/connectivity-platform/basics/flowbuilder-steps-glossary.md#01g1jen5k3hqacptnejekwb75t), or managing the conversation in [Inbox](https://inbox.messagebird.com/).

<figure><img src="/files/Bw8enMtqWX6VxisXAkgq" alt=""><figcaption></figcaption></figure>

#### Messenger Referrals Variables <a href="#id-01g6x1fd6xz0fneqbncjbqxdx2" id="id-01g6x1fd6xz0fneqbncjbqxdx2"></a>

Meta [Messaging Referrals](https://developers.messagebird.com/quickstarts/facebook/referrals/) have a set of variables that can be exploited in Flow Builder. Variables starting with:<br>

* `conversationMessageFacebookReferral` correspond to messages from [m.me link with a referral parameter](https://developers.facebook.com/docs/messenger-platform/discovery/m-me-links) and [Facebook Chat Plugin](https://developers.facebook.com/docs/messenger-platform/discovery/facebook-chat-plugin)
* `conversationMessageFacebookReferralAd` relate to values populated when end-users click on call to action on Facebook Ads.<br>

#### Messenger Referrals Developers Documentation <a href="#id-01g6ww6b9wsp8f6v627jcf2cgr" id="id-01g6ww6b9wsp8f6v627jcf2cgr"></a>

Developers' documentation for the [Messenger Referral](https://developers.messagebird.com/quickstarts/facebook/referrals/) message type is at the following [link](https://developers.facebook.com/docs/messenger-platform/reference/webhook-events/messaging_referrals/)&#x20;

📤  Feel free to [contact our Support](https://support.messagebird.com/hc/en-us/requests/new) in case you might need some help!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bird.com/connectivity-platform/how-to-guides/managing-meta-messenger-referrals-in-flow-builder.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
