> For the complete documentation index, see [llms.txt](https://docs.smartbotpro.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smartbotpro.io/scripts/variables/variable-ref.md).

# Variable %ref%

### First a little theory

{% hint style="info" %}
**A referral link** is a link that contains information from where the user follows it.&#x20;
{% endhint %}

For example, we place a link in an advertising campaign, and users get to our bot through it.&#x20;

The bot reads the link, extracting the %ref% parameter, which specifies the referral source.&#x20;

Description of the %ref% and %ref\_source% parameters can be seen in the "Variables" section:

![](/files/EzqwflriYTMGcm5E9Bhb)

### How to use it?

Write a link like this...

* For VK groups:

> [https://vk.me/группа?ref= ](https://vk.me/group?ref=)

* For Telegram:&#x20;

> <https://t.me/channel?start=>

Instead of "group" or "channel" - the name of your community from the address bar. After the = sign, indicate in Latin letters the source where you place this link, for example, "advertisement".

So the finished link might look like this:&#x20;

* <https://vk.me/club192634149?ref=advertisement>
* <https://t.me/smartbotpro?start=advertisement>

After clicking on the link, the "reklama" parameter will be saved as a person's user variable, and in the future, the parameter can be used for conditions in the script.

![](/files/flyPnolh5xnUGjC9glTL)

Now you know how to create and apply referral links in Smartbot Pro!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.smartbotpro.io/scripts/variables/variable-ref.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
