# Source (referral) wise Automation

You can create referral source wise automation for Messenger, Instagram and WhatsApp through MyAlice Automation.

{% hint style="info" %}
Once you create referral rule, you can see the referral usage in Reporting. Customer Metrics will include count of unique and total referral trigger. Also Customer Attributes will include the latest referral source for that customer.
{% endhint %}

### Creating Referral rule for WhatsApp (Click to WhatsApp ads)

1. On top of the sequence, click on the "Create a Rule" option.&#x20;
2. Select **referral** as Action.
3. Add the fb ad link as referral value (example: [https://fb.me/3IDfDFibx)](https://fb.me/3IDfDFibx)
4. Once created, anyone clicking on that ads CTA WhatsApp button will get the sequence automatically triggered.
5. You will also be able see the source as Customer Attributes against that customer.

### Creating Referral rule for Messenger

1. On top of the sequence, click on the "Create a Rule" option.&#x20;
2. Select Messenger as source channel, and **referral** as Action.
3. Create the referral value for which you want to trigger the sequence.
4. Once created, you can copy the link that will trigger the sequence, or create a QR code with that link as well.&#x20;
5. The link will have this format: `https://m.me/<USERNAME>?ref=<REF_VALUE>`

<figure><img src="/files/nB5YIRQturwMYINk3fI9" alt=""><figcaption><p>Creating Referral based Rule for Messenger</p></figcaption></figure>

### Creating Referral rule for Instagram DM

1. On top of the sequence, click on the "Create a Rule" option.&#x20;
2. Select Instagram Messenger as source channel, and **referral** as Action.
3. Create the referral value for which you want to trigger the sequence.
4. Once created, you can copy the link that will trigger the sequence, or create a QR code with that link as well.&#x20;
5. The link will have this format: `https://ig.me/m/<USERNAME>?ref=<REF_VALUE>`

<figure><img src="/files/UXgP9V8xFrWTv4EFua1x" alt=""><figcaption><p>Create Referral rule for Instagram DM</p></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.myalice.ai/myalice-guide-arabic/chatbot-and-automation/create-rules-to-trigger-a-sequence/source-referral-wise-automation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
