Home · Blog · Tags as a segmentation system: how to mark a bot’s base and what it gives

Tags as a segmentation system: how to mark a bot’s base and what it gives

· updated · Command CHBT · Segments, Contacts

A bot's database without markup is a list of names that can only be written to everyone at once. Six months later, there are a thousand contacts in it, and no one knows which of them asked about the course, who came with a QR on the package, and who bought it a long time ago and is receiving a “newbie discount” for the third time. In CHBT, the only segmentation tool is tags: they are set by a script, widget or person, “Contacts” are filtered by them, the audience of “Newsletters” is collected and the script is branched with the “Condition” block. Below is how to design a tagging system so that it doesn’t fall apart by the third campaign, and where its boundaries are.

Why segmentation relies on tags and not fields

In the contact card CHBT, data about a person is in three places, and only one is suitable for segmentation.

  • Variables live inside the conversation: the “Data Collection” block writes a response “Into a variable”, “Condition” reads it, “HTTP request” sends it outside. But when the script is launched by a new trigger, the variables are reset to zero. You cannot segment by them - they are not in “Contacts” and “Mailouts”.
  • Card fields — name, phone number, e-mail and your own fields like “City” or “Budget”. These are values, they are stored permanently, but you cannot filter the list of contacts by them: the search works by name and contacts, selection - only by tag.
  • Tags — “yes/no” tags on the contact: there is a tag - there is a sign. The tag works as a filter in “Contacts”, audience selection in “Maillists” and a branch in “Conditions”. This is the only sign that all three tools see.

Hence the design rule: everything for which you ever want to select people should be a tag. The client’s city is in its own field, but “from Moscow” for mailing about an offline master class is a tag geo-MSK, placed in the branch of the “Moscow” button.

Four tag sources in CHBT

The tag appears on a contact in one of four ways. They need to be understood so that the system is complete - without “holes” where a person has passed an important step and remains unmarked.

  1. Action in the script. Block “Action” → “Add tag” or “Remove tag”. Main source: the bot sets the tags while the person follows the script. One “Action” can contain several tags in a row.
  2. Input source. The “Deeplink” trigger fires on a link t.me/bot?start=payload in Telegram and analogue in MAX; each payload has its own trigger and its first “Action” with a source tag. The QR Campaigns section generates such links for codes on the packaging or stand. For a widget there is a trigger “Opening a widget”, for a channel there is a “Condition” trigger in the “Channel” field.
  3. Widget on the site. When a visitor clicks “Leave Contacts” and fills out the form, CHBT gives the contact a service tag widget-lead and creates a deal. You don’t configure this tag, but take it into account in the scheme: this is a ready-made “left contacts on the site” segment.
  4. Hands in a card. In “Contacts”, open the contact and edit the “Tags” field. This is how the manager notes something that the bot cannot know: paid, refusal, vip.

You cannot add tags en masse using a filter in your account - only using a script or one contact at a time. Therefore, it is better to design the markup before launch, rather than after.

Naming rules that will survive the year

A tag is just a string, and without discipline, in three months the database will have lead, Application, leads and zayavka. Filter and broadcast compare tags literally, case-sensitively, so they are four different segments. Rules we recommend:

  • One alphabet and lower case. Cyrillic or Latin - your choice, but not mixed. The Cyrillic alphabet is more convenient for operators, the Latin alphabet is more convenient if the tags go to an external CRM via an HTTP request.
  • The group prefix is hyphenated. src- source, int- interest, st- stage, camp- campaign. The prefix immediately shows what the tag is and whether it can be deleted.
  • No spaces or commas. In “Newsletters,” the audience is specified by a list of tags separated by commas—a tag with a comma inside will split into two.
  • Date in campaigns. camp-2026-09-opening, not promotion: in a year you won’t remember which one.
  • A fact, not an assessment. int-rate (clicked the “Course” button) better than hot: a fact does not become obsolete, an assessment does.

An example of a diagram for a studio with three products and two traffic channels:

GroupTagsWho betsWhen they film
Sourcesrc-vk, src-qr, src-siteflow, first action of the branchNever
Interestint-mk, int-rate, int-certScript, button branchNever (there may be several interests)
Stagest-magnet, st-lead, st-paidScript; st-paid — managerDon’t remove it: stages accumulate
Conditionwaiting for a call, in-mailing-reactScript or managerRemoved when leaving the state
Campaigncamp-2026-09-openingScript on campaign deep linkAfter 3–6 months, during audit

Enter this list into a “Note” on the script canvas - the block does nothing, but the next person who opens the bot will see the system, not a bunch of words.

Tags by source: deep link, QR, widget, channel

The source is the most valuable tag because it cannot be restored retroactively: after a month, you will no longer know where a person came from. Marking by sources in CHBT is based on triggers.

Deeplinks. Each site has its own link: t.me/bot?start=vk in a VKontakte ad, ?start=soc in the social network profile header, ?start=email in a letter. In the script, there is a “Deep Link” trigger for each payload (the matching pattern is specified by a regular expression, so ^camp- will catch all campaigns at once). The first block of each branch is “Action” → “Add tag” src-…, then the branches converge into a common greeting. One script, three inputs, three tags. In MAX, links with payload work the same way.

QR codes. In the “QR campaigns” section, each campaign has a name, payload and a ready-made code with a deep link. Code on the counter - ?start=qr-rack, insert in the parcel - ?start=qr-package. CHBT counts scans for each campaign, and the tag in the script records the source on the contact. Template “Buyer bot” This is how it works: deep link with QR → tag qr buyer → transaction in CRM.

Widget. The “Open widget” trigger runs a script when a visitor opens a chat on the site. Placed here src-site. If the site is multi-page, the bot will not recognize the source of the page - only the fact that the person came from the site.

Channel. If the same /start comes from Telegram, MAX and VKontakte, you can mark the channel with “Condition” in the “Channel” field: three branches - three tags ch-tg, ch-max, ch-vk. However, the channel is already recorded in the contact card and is visible in “Contacts”, so the tag is only needed for sending strictly to one messenger.

Behavior tags: stages, interests, states

Behavioral tags answer the question “what did the person do”, and one subtlety is important here - to distinguish between cumulative and switchable.

Cumulative (stages and interests) are only added. The person who took the lead magnet and then left the phone is wearing and st-magnet, and st-lead. There is no need to remove the first one: it says that the person has completed this step, and allows you to calculate the conversion between stages - the number of contacts with st-lead divide by number c st-magnet. For more information on how to calculate a funnel by tags, see the article about leads, lead magnets and qualifications.

Switchable (states) describe where a person is now, and they need to be removed. Classic couple: lead flow puts waiting for a call, the manager after the conversation deletes it in the card and puts st-paid or refusal. While the tag is active, the contact is visible in the Contacts filter as unprocessed. If they forget to remove it, the segment loses its meaning within a week, so there should be few states, and the person responsible for the removal should be named by name.

Where to put behavioral tags in the script: not “at the end”, but immediately after the event. The interest tag is in the button thread, and not after collecting the phone, otherwise those who selected the product and left are not tagged. The stage tag is in the same “Action” where the stage itself occurs: next to the “Message” with a link to the magnet, next to the “Transaction in CRM”. One “Action” can contain both “Add tag” and “Remove tag” - the transition from state to state is executed in one block.

What to do with a segment: filter, condition, mailing, uploading

The markings pay off in four places in the cabinet.

Filter in Contacts. “Tag” field in the top panel - enter a tag and see only contacts with it; Nearby there is a search by name, phone and e-mail. The filter takes one tag at a time, so the question is “who int-rate, but without st-paid» is resolved either by a state tag (waiting for a call), or unloading.

"Condition" in the script. “Tag” field, “set” or “not set” operator. So the bot does not offer a newbie discount to a person with st-paid, does not issue a magnet a second time to someone who has st-magnet, and leads src-qr Go straight to the warranty section. One condition can have several rules and several branches.

Audience in “Newsletters” (Basic and higher). Field “Tags separated by commas”: the newsletter will go to everyone who has at least one from the listed tags. This is “or”, not “and”: int-course, int-mk — everyone who was interested in the course or master class. It is impossible to exclude a segment, so “everyone except those who bought” is done through the state: until the person has bought, he has non-client, and the mailing goes through it. An empty field is the entire database. How mailing via a bot works is discussed on the page newsletters in Telegram.

CSV export. The “CSV” link in “Contacts” gives the entire database: name, e-mail, phone, channel, tags separated by semicolons, creation date. For complex selections - “and”, “except”, “created before date” - open the file in the table and filter there. This is the only way to see the distribution by tags in numbers: a summary table by tag column.

Limitations you should be aware of before marking

The tag system in CHBT is simple - and this is its strength and limit. What she can't do:

  • No "and"/"except" logic in the newsletter audience - only “or” according to the list. Design states so that one tag describes one desired segment.
  • No auto-tagging by time. The bot will not add the tag “haven’t written for 30 days”: it does not have a condition for the date of the last message. Inactive people are found via CSV by date or through a survey campaign - how to do this is shown in the article about reactivating a sleeping base.
  • There are no tag counters in the interface. How many contacts with src-qr — visible in the list after the filter or in CSV, there are no separate statistics.
  • No mass operations. You cannot tag one hundred contacts using the filter; only by script (via mailing list with a keyword) or one per card.
  • Tags are at the bot level. If you have several bots in your account, each has its own database and its own tags; There is no general reference book.
  • Case and typos are important. Application and lead — different tags for filters, conditions and broadcasts.

None of this prevents the database from working with several thousand contacts; it is the lack of a circuit that does. The diagram from the naming section covers most problems without “and/except” logic.

How to tag a database that has already accumulated without tags

A common situation: the bot worked for six months, there were eight hundred people in Contacts and not a single tag. It will no longer be possible to restore the sources, but interests and stages can be done in three moves.

  1. Upload CSV and look at what is available: who has a full phone number (these are former leads), who only has a name (they came and left), what channels. Already using this file you can manually enter st-lead the most valuable are those who have a phone number and a recent date.
  2. Run self-segmentation. A newsletter in the “Mailouts” section with text like “We have updated the program. Write courseif you are interested in classes, or mk, if it’s a one-time master class.” The script contains a “Keywords” trigger for each word and an “Action” with an interest tag. There are no buttons in the broadcasts, so these are the keywords: short, one word, without the risk of typos. Part of the base will respond - these are your live leads, tagged with their own hands.
  3. Add tags to the current script according to the scheme from this article, so that new contacts arrive marked. Check through “Check Script” in the editor that the tag is placed in the right place: go through the thread and open your card in “Contacts”.

Those who did not respond to the survey mailing list, do not consider them lost - just note the fact: this is the first wave of reactivation, and it is a separate discussion.

Tag audit once a quarter: checklist

The tagging system degrades not from the load, but from new people and new campaigns. Once a quarter - 20 minutes according to the list:

  1. Upload the CSV and collect all the unique tags. Duplicates by case and typos - combine: go through the script and correct the action, correct old contacts by hand if there are few of them.
  2. Tags without a prefix - understand what they are and rename them according to the scheme or remove them from the script.
  3. For campaigns older than six months, remove triggers and actions from the script to avoid accumulating dead branches.
  4. Check states: how many contacts with waiting for a call older than two weeks. If there is a lot, the tag is not removed, and he is lying.
  5. Open the “Note” with the diagram in the script and update it: new tags, who is responsible for what.
  6. Make sure that in each source branch there is src-, and in each thread there are buttons of interest - int-. One forgotten branch is a hole in the segment for the entire block.

Tags, Contacts filter and CSV export are available on the Free plan; broadcasts by tags - from Basic for 650 ₽ per bot per month. What is included in the Plans - on the page “Plans” page. Create a bot and configure tags →

More on the blog