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

# Templates & Placeholders

> Use dynamic placeholders in your message creatives

Trackly SMS supports dynamic placeholders in creatives for tracked links and personalization.

## Link Placeholders

### Basic Usage

Use `{{link1}}`, `{{link2}}`, etc. for tracked links:

```
Shop our sale: {{link1}}
```

When sent, this becomes a short tracking URL:

```
Shop our sale: trk.ly/abc123
```

### Multiple Links

Include multiple links with different offers:

```
🔥 Flash sale!

50% off clothing: {{link1}}
30% off electronics: {{link2}}
Free shipping on orders $50+: {{link3}}
```

Each link can be bound to a different offer in the creative settings.

### Binding Offers to Links

In the creative editor:

1. Write your message with `{{linkN}}` placeholders
2. In the "Offer Bindings" section, map each placeholder:

| Placeholder | Offer                 |
| ----------- | --------------------- |
| `{{link1}}` | Summer Clothing Sale  |
| `{{link2}}` | Electronics Clearance |
| `{{link3}}` | Free Shipping Promo   |

### Link Tracking

Tracked links provide:

* Click counts
* Click timestamps
* Revenue attribution
* Bot detection

See [Link Tracking](/guides/link-tracking/overview) for details.

## URL Parameters

Offers can include URL parameters that pass through to the destination:

```
Offer URL: https://store.com/sale?promo=summer24
Short link: trk.ly/abc123
Final redirect: https://store.com/sale?promo=summer24&click_id=xyz
```

Additional parameters (like click\_id) are appended for attribution.

## Account-Level Templates

### Prepend Text

Text automatically added to the start of every message. The default prepend is `{{brand_name}}:` (your brand name followed by a colon).

```
Account prepend: "{{brand_name}}: "
Creative: "Check out our sale: {{link1}}"
Final message: "Acme: Check out our sale: trk.ly/abc123"
```

### Append Text

Text automatically added to the end of every message. The default append is `Reply stop to stop. Help for help.`

```
Account append: " Reply stop to stop. Help for help."
Creative: "Flash sale! {{link1}}"
Final message: "Flash sale! trk.ly/abc123 Reply stop to stop. Help for help."
```

### Configuring

Set prepend/append in **Account Settings > Messaging**.

Prepend and append text count toward your character limit. Factor this into creative length. Together, the default prepend and append add approximately **34 characters** of compliance overhead.

### List-Level Overrides

Sending list settings can override account-level prepend and append text. If a list specifies its own prepend or append, those values take precedence over the account defaults for sends to that list.

## SMS Segments

### Standard SMS

160 characters per segment. Messages exceeding this are split:

| Length  | Segments |
| ------- | -------- |
| 1-160   | 1        |
| 161-306 | 2        |
| 307-459 | 3        |

<Warning>
  Multi-segment messages use \~7 characters per segment for concatenation headers, reducing effective capacity.
</Warning>

### Unicode Messages

Messages with emoji or special characters use Unicode encoding:

| Length  | Segments |
| ------- | -------- |
| 1-70    | 1        |
| 71-134  | 2        |
| 135-201 | 3        |

### Character Counting

The creative editor shows:

* Raw character count
* Segment count after placeholders resolve
* Link length: each `{{linkN}}` placeholder resolves to approximately **23 characters**
* Compliance overhead: prepend + append text adds approximately **34 characters**

<Note>
  When estimating segment count, remember to add \~23 characters per link placeholder **and** \~34 characters of compliance text (prepend + append) to your raw character count. This overhead often pushes a message into an additional segment.
</Note>

## Personalization

Use dynamic placeholders to personalize messages for each contact:

| Placeholder                   | Description                                   | Example Output |
| ----------------------------- | --------------------------------------------- | -------------- |
| `{{brand_name}}`              | Account brand name                            | Acme           |
| `{{first_name}}`              | Contact's first name                          | Jane           |
| `{{last_name}}`               | Contact's last name                           | Smith          |
| `{{phone_number}}`            | Contact's phone number                        | +14155551234   |
| `{{day_of_week}}`             | Current day of week                           | Wednesday      |
| `{{date}}`                    | Current date (US format)                      | 02/09/2026     |
| `{{linkN}}`                   | Tracked link (`{{link1}}`, `{{link2}}`, etc.) | trk.ly/abc123  |
| `{{sendId}}` or `{{send_id}}` | Unique message send ID                        | AbC12345       |

### Custom Contact Fields

Access any custom field stored on a contact using bracket notation:

```
Hey {{first_name}}, your VIP status is {{contact["vip_status"]}}!
```

Both single and double quotes work: `{{contact["field_name"]}}` or `{{contact['field_name']}}`.

If a personalization field is missing for a contact, it resolves to an empty string. Design your messages so they read naturally even without personalization values.

### Example

```
Hey {{first_name}}, happy {{day_of_week}}! Check out today's deal: {{link1}}
```

For a contact named "Jane" on a Wednesday, this becomes:

```
Hey Jane, happy Wednesday! Check out today's deal: trk.ly/abc123
```

## Best Practices

<AccordionGroup>
  <Accordion title="Keep links short">
    Short link URLs are \~20 characters. Account for this in your character budget.
  </Accordion>

  <Accordion title="Test link rendering">
    Preview your creative to see how links will appear to recipients.
  </Accordion>

  <Accordion title="One primary CTA">
    Too many links can confuse. Have one primary action and make it prominent.
  </Accordion>

  <Accordion title="Avoid special characters">
    Stick to standard ASCII when possible to avoid Unicode segment limits.
  </Accordion>
</AccordionGroup>

## Example Templates

### Sale Announcement

```
🔥 Flash Sale! 50% off everything for 24 hours only.

Shop now: {{link1}}

Reply STOP to opt out.
```

### New Arrival

```
Just dropped: New {{category}} collection.

Be the first to shop: {{link1}}

STOP to unsubscribe.
```

### Re-engagement

```
We miss you! Here's 20% off your next order.

Claim your discount: {{link1}}

Expires in 48 hours. Reply STOP to opt out.
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Link Tracking" icon="link" href="/guides/link-tracking/overview">
    How link tracking works
  </Card>

  <Card title="ML Selection" icon="robot" href="/guides/creatives/ml-selection">
    Automated creative selection
  </Card>
</CardGroup>
