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

# Personalization

> Map dynamic variables in campaign templates to customer, order, and product data for personalized message delivery.

Campaign messages support dynamic content through template variable mapping. Variables defined in a template at creation time — such as `{{1}}` or `{{2}}` — are mapped to real customer or order data fields when a campaign is configured. At send time, Galantis populates each variable with the recipient's actual data before dispatching the message to the WhatsApp API.

Personalized messages perform better than generic broadcasts. Addressing a customer by name, referencing their last order, or surfacing a product they viewed increases relevance and reduces the likelihood of a block or report.

## What this covers

* How template variables are defined and mapped
* Available data sources for variable values
* How to configure variable mapping in a campaign
* Fallback behavior when data is missing

## How variable mapping works

Template variables are positional placeholders — `{{1}}`, `{{2}}`, `{{3}}` — defined in the template body and optionally in the header. When you select a template for a campaign, Galantis presents each variable placeholder and lets you assign it a dynamic value from your customer or order data.

The mapping is stored as a `template_variables_mapping` configuration on the campaign:

```json theme={null}
[
  { "initialValue": "{{1}}", "selectedValue": "customer.first_name" },
  { "initialValue": "{{2}}", "selectedValue": "order.total_price" }
]
```

At send time, each placeholder is replaced with the corresponding value from the recipient's Shopify profile.

## Available variable values

<Tabs>
  <Tab title="Customer Data">
    The following customer fields are available as variable values:

    | Field                 | Value                    |
    | --------------------- | ------------------------ |
    | `customer.first_name` | Customer's first name    |
    | `customer.last_name`  | Customer's last name     |
    | `customer.email`      | Customer's email address |
    | `customer.phone`      | Customer's phone number  |

    `customer.first_name` is the most commonly used variable — opening a message with the customer's name meaningfully increases engagement compared to a generic greeting.
  </Tab>

  <Tab title="Order Data">
    Order data variables reference the customer's most recent order unless otherwise specified.

    | Field                | Value                                  |
    | -------------------- | -------------------------------------- |
    | `order.order_number` | Shopify order number                   |
    | `order.total_price`  | Order total                            |
    | `order.product_name` | Name of the first product in the order |

    Order data variables are most useful in post-purchase campaign contexts — for example, a cross-sell campaign that references the customer's recent purchase.

    <Note>
      Order data variables reference Shopify order records synced into Galantis. If a customer has no order history, these variables may be empty. Configure a static fallback value where appropriate.
    </Note>
  </Tab>

  <Tab title="Store & Static">
    **Store name**: The name of your Shopify store — useful for brand reinforcement in the message body.

    **Custom static text**: A fixed string you type directly into the variable mapping. Use this for:

    * Discount codes that apply to all recipients (`SUMMER20`)
    * Static URLs for landing pages or collection links
    * Fixed product names or offer descriptions for campaigns where the content does not vary per recipient

    Static text is the right choice when a variable slot needs a value but no dynamic customer or order data is appropriate for that position.
  </Tab>

  <Tab title="Product Data">
    For catalog-based message formats (SPM and MPM), product data is pulled directly from your synced Meta Catalog rather than from template variable mapping. Product name, price, image, and variant data are populated automatically from the catalog record.

    Standard template body variables (`{{1}}`, `{{2}}`) can still be used alongside catalog product data — for example, a variable greeting in the body text while the product card is populated from the catalog.

    See [Message Composition](./message-composition) for how catalog product data works in SPM and MPM formats.
  </Tab>
</Tabs>

## Configuring variable mapping in a campaign

<Steps>
  <Step title="Select your template">
    In the campaign builder, choose an approved template. Galantis detects the variable placeholders defined in that template.
  </Step>

  <Step title="Map each variable">
    For each placeholder (`{{1}}`, `{{2}}`, etc.), select a value from the available data fields or enter custom static text.
  </Step>

  <Step title="Preview the mapping">
    Review the mapping before proceeding. Confirm that each variable is assigned a value that makes sense in the context of the message body.
  </Step>
</Steps>

## Best practices

* **Always map `{{1}}` to `customer.first_name` when the template opens with a greeting.** This is the single highest-impact personalization variable and requires no extra configuration.
* **Use static text for offer codes.** Discount codes are the same for all recipients — map them as static text rather than leaving the variable unmapped.
* **Avoid mapping email or phone to visible message body variables.** Customers generally do not expect to see their own contact details reflected back to them in a promotional message.
* **Review mappings when reusing templates across campaigns.** A variable mapping that worked for a post-purchase send (using `order.total_price`) will not make sense in a re-engagement campaign where many recipients have no recent order.

## Related guides

* [Message Composition](./message-composition) — Template formats and their variable support
* [Templates — Variables & Localization](/whatsapp/templates/variables-localization) — How variables are defined in templates
* [Audience Targeting](./audience-targeting) — Combining personalization with precise audience selection
