> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.bitbybit.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Send referral links in a campaign

> Send each customer their own referral link in a WhatsApp Cloud API campaign by mapping a template parameter to a Referral link variable.

Send one WhatsApp campaign where each customer gets their own referral link. Add a parameter to a Marketing template, then map it to a **Referral link** variable when you create the campaign.

## Prerequisites

* Referral is on and **Ready**. See [Set up referral](https://knowledge.bitbybit.studio/loyalty/how-to-set-up-referral.md).
* WhatsApp Cloud API is connected. For Shopify links, the referral script is also active.
* A customer segment to send to. See [How to create a customer segment](https://knowledge.bitbybit.studio/bitcrm/how-to-create-a-customer-segment.md).

> [!NOTE]
>
> Referral link variables work only with **Marketing** templates, not **Utility** templates.

**1. Create a Marketing template with a parameter**

* Create a WhatsApp Cloud API template with **Message category** set to **Marketing**.
* In **Message content**, click **Add variable +** where the link goes, for example: `Invite a friend and you both earn points. Your link: {{1}}`
* Click **Add sample values**, fill them in, and submit the template to Meta for approval.

For details, see [How to create a Message Template Campaign for WhatsApp Cloud API](https://knowledge.bitbybit.studio/bitcrm/how-to-create-a-message-template-campaign-for-whatsapp-cloud-api.md).

**2. Create the campaign**

* Open [**bitCRM > Campaign**](https://app.bitbybit.studio/bitcrm/campaign), click **Create new campaign**, and choose **WhatsApp Cloud API**.
* Enter a **Campaign name** and select the segment in **Send to**.
* Choose **Send immediately** or **Schedule send**.

**3. Map the parameter to a referral link**

* In **Message template**, select your Marketing template.
* In the **Variable** dropdown next to the parameter, scroll to the end of **Built-in variables** and pick **Referral link — Shopify** or **Referral link — Commerce**.

  ![Variable dropdown with Referral link — Shopify and Referral link — Commerce at the end of the Built-in variables list.](https://mintcdn.com/asmaraku/RW8xKVEP7IzD5HXi/images/loyalty/referral-campaign-variable-list.png?fit=max\&auto=format\&n=RW8xKVEP7IzD5HXi\&q=85\&s=babfe922151c24b91f4c0860ffce166e)

An example link appears under the dropdown and in the preview. Each recipient gets their own link when the message is sent.

![Message template field with the first parameter mapped to Referral link — Shopify, and an example link shown under the Variable dropdown.](https://mintcdn.com/asmaraku/RW8xKVEP7IzD5HXi/images/loyalty/referral-campaign-variable-selected.png?fit=max\&auto=format\&n=RW8xKVEP7IzD5HXi\&q=85\&s=0a1e205ff0dad2f554a22e50622f0410)

**4. Review and send**

* Click **Review**, check the details, then confirm.

Customers who aren't identified or have no referral link don't receive the message.

Track results in [campaign analytics](https://knowledge.bitbybit.studio/bitcrm/how-to-view-campaign-analytics-in-bitcrm.md) and [Referral history](https://knowledge.bitbybit.studio/loyalty/referral-history-reference.md).

## FAQ

> [accordion] Why don't I see the Referral link variables?
>
> Check that the template category is **Marketing**, bitLoyalty is on, and referral is **Ready**.

> [accordion] Does every recipient get the same link?
>
> No. Each customer gets their own link, so each referral is credited to the right person.

> [accordion] Can I share a link outside a campaign?
>
> Yes. Customers can also get it from the AI agent, the **Refer a friend** card on your Shopify store, or you can copy it from the customer detail page. See [Share referral links](https://knowledge.bitbybit.studio/loyalty/how-to-set-up-referral.md#share-referral-links).

## Related

* [Set up referral](https://knowledge.bitbybit.studio/loyalty/how-to-set-up-referral.md)
* [Understanding referral](https://knowledge.bitbybit.studio/loyalty/understanding-referral.md)
* [How to create a new WhatsApp Cloud API Campaign with bitbybit](https://knowledge.bitbybit.studio/bitcrm/how-to-create-a-new-whatsapp-cloud-api-campaign-with-bitbybit.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.