A macro is a special string inside a text block that is replaced with the required data during sending:
-
the value of one of the subscriber’s profile fields (for example, the name or a custom field value);
-
a relative date (the current date or the current date + X days);
-
individual links used for specific integrations (for example, payment automation).
The macro format looks like this: {%first_name%}
The field name or date parameters are written inside the curly braces.
Example:
The macro {%first_name%}
will automatically be replaced with the subscriber’s name inside the message.
(!) Macros work in URL buttons. BotHelp detects them, substitutes the necessary data, and then shortens the link into a form like https://s.bothelp.io/xxxxxx.
(!) Macros cannot be used inside shortened links from third-party services. In this case, BotHelp will not be able to find the macro and replace it with text.
Where to find macros?
Macros can be found in the menu <...>
in all text blocks.
Field as a macro
Any field can be used as a macro. To do this, select the required field from the list of macros. The field’s value will be inserted into the text without changes.
Use cases:
— To address a subscriber by name, use the “Name” field macro;
— To display quiz results, use the “Points” field macro where scores are counted.
Macros in bot button titles
In an inline button’s title, you can use macros such as:
-
the value of one of the subscriber’s profile fields (e.g., name or custom field value);
-
relative date (current date or current date + X days);
-
global variables.
Multiple macros and manually entered text can be used simultaneously in a single button title. Any characters exceeding the limit will be truncated with an ellipsis.
Important! If a button containing a macro of an empty field is sent to a subscriber, errors may occur.
In Telegram bots, such a button will not be sent; in VK bots, neither the button nor other card elements will be sent. In bots on other channels, these buttons will not work.
If you worry about accidentally sending an empty macro, add any character or emoji to the button title.
You can select and insert a macro in the button title field using the <...>
button.
Random number generator
This macro substitutes a random number from the range specified in parentheses.
Macro format: {?random_num(0,99)?}
It returns a random number between 0 and 99.
Available only for Numeric fields.
You can set any range.
It can be used in mathematical operations.
It can also be inserted simply in text messages.
Example: If you want to offer a random discount size between 10% and 50%, the macro looks like this: {?random_num(10,50)?}
Payment macro
When you create a payment automation, a specific macro is assigned to it. In text, it appears as {%payment_x%}
and after sending, a link leading to the payment landing page is formed inside the message.
To add a payment macro, select it from the list. The subscriber will receive a message with a link to the payment landing page.
UTM tag macros
Macros store the data passed in the subscription link, specifically all UTM tags. You can add one tag to a link leading to your website like ?{%utm_source%}
or all of them at once using the macro ?{%ref%}
.
Later, you can track these tags on your website for analysis.
Relative date macro
This macro lets you avoid specifying an exact date, setting a value that will be substituted on the landing page or in the message. The date calculation is based on the current day.
Example of a date macro: {%today+1 (d F)%}
.
For more details on usage, see the article: Relative Date ↗.
Time split macro
For landing pages, there is a special macro that shows different content depending on the time when the subscriber accessed the landing page.
Example macro: {%split 18:00 today (d F) | today+1 (d F)%}
.
Learn more ↗
If you did not find the answer to your question, feel free to contact us in the chat inside your dashboard, message us on Telegram at @BotHelpSupportBot, or email us at hello@bothelp.io.
Get 14 Days of Full Access to the Platform
Enjoy the full functionality of the BotHelp platform for creating broadcasts, automated funnels, and chatbots — free for 14 days.