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

# Recipe: Refer-a-Friend on the Thank You Page

> Set up a complete referral campaign that prompts customers to share right after purchase

## Overview

The **Thank You page** (Order Status page) is the highest-converting placement for referral prompts — customers are happiest right after a purchase. This recipe walks you through setting up a campaign that captures that moment with a referral widget and an automated WhatsApp message.

**What you'll build:**

```mermaid theme={null}
graph LR
    A["🛍️ Customer Purchases"] --> B["📄 Thank You Page<br/>Shows referral widget"]
    B --> C["📱 WhatsApp Nudge<br/>Sent automatically"]
    C --> D["👋 Friend Clicks Link"]
    D --> E["🎁 Friend Gets Discount"]
    E --> F["💰 Referrer Earns Reward"]
```

**Time to complete:** \~10 minutes

***

## Steps

<Steps>
  <Step title="Create Your Campaign">
    Go to **Apps → Referbro → Campaigns**, click **Create Campaign**, and configure:

    | Field                    | Recommended Value               |
    | :----------------------- | :------------------------------ |
    | **Campaign Name**        | `Thank You Page Referral`       |
    | **Discount Strategy**    | `Fixed Amount`                  |
    | **Discount Amount**      | `150` (₹150 off for the friend) |
    | **Minimum Subtotal**     | `0` (no minimum)                |
    | **Referrer Reward**      | `150`                           |
    | **Referrer Reward Type** | `Cashback`                      |
    | **Reward Return Period** | `7` days                        |

    <Tip>
      **Why Fixed Amount?** For Thank You page campaigns, fixed discounts feel more tangible and are easier for referrers to communicate — *"Get ₹150 off!"* vs *"Get some % off."*
    </Tip>

    Configure the widget text for the Thank You page context:

    | Field             | Example                                                           |
    | :---------------- | :---------------------------------------------------------------- |
    | **First Line**    | `₹150 off for your friends`                                       |
    | **Second Line**   | `₹150 in your pocket`                                             |
    | **Share Message** | `Loved my purchase! Use my link for ₹150 off your first order 👇` |

    Click **Save**.
  </Step>

  <Step title="Add the Widget to the Thank You Page">
    1. Go to **Shopify Admin → Settings → Checkout → Customize** (or **Online Store → Themes → Customize** → select the Checkout page).
    2. Navigate to the **Thank You** page.
    3. Add the **Referbro Widget** block.
    4. Click **Save**.

    <Note>
      Also add the widget to the **Order Status** page — customers who return to check their order will see the referral prompt again.
    </Note>
  </Step>

  <Step title="Set Up the Post-Purchase WhatsApp Message">
    This sends an automated WhatsApp message right after the order, reinforcing the Thank You page prompt.

    1. Go to **Apps → Referbro → WhatsApp Settings**.
    2. Find the **Order Confirmation** template slot.
    3. Enter your approved template ID and parameters:

    ```json theme={null}
    {
      "body.1": "Thanks for your order! Share your link and your friends get ₹150 OFF 👇",
      "body.2": "{{REFERRAL_LINK}}&source=order",
      "languageCode": "en",
      "button.url.0.1": "{{REFERRAL_CODE}}&source=order_cta"
    }
    ```

    4. Toggle the template to **Enabled**.

    <Warning>
      You must create and get this template approved on your WhatsApp provider **before** mapping it here. See the [Provider Setup Guide](/docs/features/whatsapp/providers) for instructions.
    </Warning>
  </Step>

  <Step title="Test the Flow">
    1. Place a **test order** on your store.
    2. On the Thank You page, verify:
       * The Referbro widget appears with your referral code
       * Clicking "Share on WhatsApp" opens a pre-filled message
    3. Check your phone — you should receive the Post-Purchase WhatsApp message.
    4. Go to **Apps → Referbro → Analytics** and confirm:
       * A `LINK_GENERATED` event appears
       * A `WHATSAPP_SENT` event appears (if WhatsApp is configured)
  </Step>
</Steps>

***

## Best Practices

* **Keep the message short** — The Thank You page already shows the widget, so the WhatsApp message is a reinforcement, not the primary touchpoint.
* **Use the** `Allow Without Code` **option** — Enable this in Campaign Configuration so referrers earn rewards even if their friend forgets to apply the discount code at checkout. The referral link tracking is usually sufficient.
* **Add an expiry feel** — Use language like *"Share in the next 24 hours"* (even if there's no actual expiry) to create urgency.

## Related Pages

* [Campaign Management](/docs/features/campaigns) — Full reference for all campaign fields
* [Checkout Extensions](/docs/features/checkout-extensions) — Widget placement details
* [WhatsApp Touchpoints](/docs/features/whatsapp/touchpoints) — All 8 template trigger points
