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

# Magic Links: Smart Tracking URLs with Dynamic Parameters

> Create trackable deep links that capture query string parameters dynamically and redirect users to Messenger, WhatsApp, Telegram, or any destination URL.

Magic Links are smart deep links and public tracking URLs that let you measure campaign performance, pass UTM parameters to a website, or send referral parameters into chatbot conversation flows. When a user clicks a Magic Link, ChatbotX automatically redirects them to the destination URL you configured, while dynamically capturing and injecting any query string parameters using the `{{variable_name}}` double curly brace syntax.

To access Magic Links, select **Tools** from the left navigation bar and click the **Magic Links** card.

## Create a Magic Link

<Steps>
  <Step title="Open Magic Links">
    On the **Magic Links** page, click the **+ Create Magic Links** button in the top-right corner.
  </Step>

  <Step title="Configure settings">
    Fill in the two required fields in the creation form:

    * **Name** — an identifier for this Magic Link. Use only letters, numbers, underscores `_`, and hyphens `-`. This string is appended directly to the public tracking URL (e.g., `https://app.chatbotx.io/r/YOUR_BOT_ID/Ads`).
    * **URL** — the destination URL where users will be redirected. Use `{{variable_name}}` placeholders anywhere in the URL to dynamically insert query string values from the tracking link.
  </Step>

  <Step title="Create the link">
    Click **Create** to save and generate your Magic Link.
  </Step>
</Steps>

## Standard URL Formats

The table below shows standard destination URL formats you can paste into the **URL** field for common use cases. Replace the placeholder values with your own account details.

| Channel / Goal           | URL field format                                                              |
| ------------------------ | ----------------------------------------------------------------------------- |
| Facebook Messenger       | `https://m.me/PAGE_USERNAME?ref={{ref_name}}`                                 |
| Website (UTM Parameters) | `https://yourdomain.com/page?utm_source={{source}}&utm_campaign={{campaign}}` |
| WhatsApp Business        | `https://wa.me/PHONENUMBER?text=/ref_{{campaign}}`                            |
| Telegram Bot             | `https://t.me/BOT_USERNAME?start={{ref_code}}`                                |

## How Redirect and Variable Substitution Works

When a user clicks the public tracking URL — for example:

```
https://app.chatbotx.io/r/11588479527206912/Ads?campaign=summer_sale&source=facebook
```

ChatbotX reads the query string parameters (`campaign=summer_sale`, `source=facebook`) and substitutes them into the destination URL you configured. If the URL field contained:

```
https://m.me/chatbotx?ref=ads.{{campaign}}.{{source}}
```

The user is redirected to:

```
https://m.me/chatbotx?ref=ads.summer_sale.facebook
```

<Note>
  If a query string parameter is omitted from the tracking URL, the corresponding `{{variable_name}}` placeholder safely resolves to an empty string, so your destination URL will never break.
</Note>

## Managing Your Magic Links

After creation, each Magic Link appears in the management table. Click the **…** action menu at the end of any row to perform the following actions:

| Action             | Description                                                                                                                 |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| **Copy URL**       | Copies the public tracking URL (e.g., `https://app.chatbotx.io/r/BOT_ID/Name`) to paste into ads, social posts, or buttons. |
| **QR Code**        | Automatically generates a QR code for the Magic Link.                                                                       |
| **View Analytics** | Opens real-time click analytics and performance reports.                                                                    |
| **Edit**           | Updates the **Name** or destination **URL**.                                                                                |
| **Delete**         | Removes the Magic Link from the system.                                                                                     |

## Best Practices

* **Name field:** Use only letters, numbers, underscores `_`, and hyphens `-`. Avoid spaces or special characters, which will break the public tracking URL structure.
* **Variable substitution:** Every `{{variable_name}}` in the URL field is dynamically replaced by the matching query string parameter passed through the public tracking URL. Variables with no corresponding parameter resolve to an empty string.
* **Unique names per campaign:** Give each Magic Link a descriptive, unique name so you can easily identify its purpose in the analytics view.
* **Test before launching:** Click your Magic Link with sample parameters and verify that the destination URL receives the correct values before publishing an ad campaign.
