Segments
- Features →
- Setting up the “Segments” section →
- Adding users to segments through the “Segments” section →
- Example of creating a multi-level hierarchy in the “Segments” section →
- Setting up the “Add to segment” component →
- Creating a new segment through the component →
- Setting up the “Remove from segment” component →
- Adding users to segments using variables →
Segments divide users into groups and subgroups, allowing you to work with them more precisely: send broadcasts to specific segments, build scenarios, and route users through different bot flows depending on their segment.
Features
In the Segments section and using segmentation components, you can create segments to group users, as well as add users to and remove users from segments.
Segments support a hierarchical structure and can be either parent or child segments. A single parent segment can contain multiple child segments.
For example:
Buyers (parent segment)
Contains three child segments:
- We bought clothes
- We bought shoes
- Abandoned cart
If you send a broadcast to the buyers parent segment, it will be delivered to users in all child segments.
If you select a specific child segment, such as Purchased clothing, the broadcast will be delivered only to users in that child segment. Users in other child segments will not receive the broadcast.
Additionally, segments can be used in the Fork component to check whether a user belongs to a specific segment.
Setting up the “Segments” section
Go to the Segments section and click New Segment.
2. Enter the name of the new segment. Add a description if necessary.
If segments already exist in the bot, you will be able to select a parent segment and create a nested child segment.
In our example, there are no segments in the bot yet, so it is not possible to create a segment with a parent segment, since at least one segment must exist to be assigned as a parent.
To finish, click Create.
3. If everything has been done correctly, you will receive a success message.
Now you can create a child segment.
4. Click New Segment again.
5. Enter a name for the segment.
6. In the Parent segment field, select one of the previously created segments.
If necessary, add a description of the segment and click Create.
You can continue adding segments in the same way — both parent and child segments.
Unnecessary segments can be deleted in this same section. To do this, click the three dots next to the segment you want to remove.
If there are nested segments, you must delete them first. A parent segment cannot be deleted if it contains child segments.
You can also copy the segment path as plain text and later paste it into component fields for adding or removing segments, or into the Fork component.
After all required segments have been created, you can go to the Broadcasts section or the bot builder and use the Fork component to route users within the scenario.
Adding users to segments through the “Segments” section
Users can be added to segments in two ways: manually via the Segments section, where you select users yourself, or automatically when a user passes through the Add to segment component in the bot.
Let’s look at the manual method via the section.
1. Select the segment you want to add users to and click on its name.
2. Click the Edit button in the top-right corner.
3. Click Add users.
A list of users will open, where you can select and add those who should be included in the segment. Click Add.
There is also a search field where you can filter users by ID, platforms, or find a specific user using the search box.
You can remove a user by clicking the relevant segment and then clicking Remove.
Under the About segment tab, you can find more detailed information about the segment itself — its name, parent segment (if any), and description.
All of this information can be edited. To do so, click Edit and update the details. After that, click Save.
You can delete a segment using the Delete button.
Example of creating a multi-level hierarchy in the “Segments” section
Segments support up to 10 levels of nesting, including the parent segment.
In practice, this means the structure can look like this:
Students (parent segment) with nested child segments:
- Enrolled in the course
- We completed the first lesson
- We completed the second lesson
- We completed the third lesson
- We completed the fourth lesson
- We completed the fifth lesson
- We completed the sixth lesson
- We completed the seventh lesson
- We've completed the eighth lesson
Setup
1. Create a parent segment. To do this, click New Segment.
2. Name your segment and click **Create**. In this example, we named the parent segment Students.
3. Click New Segment again and give the second segment a name. In our example, it is Enrolled in the course. Select the previously created segment Students as the parent segment. Click Create.
4. Click New Segment again and name the third segment. In our example, it is We completed the first lesson. As the parent segment, select the previously created second-level segment Students → Enrolled in the course. Click Create.
5. Click New Segment again and name the fourth segment. In our example, it is We completed the second lesson. As the parent segment, select the previously created third-level segment Students → Enrolled in the course → We completed the first lesson. Click Create.
By continuing to select the parent segment in this way, you can create a more multi-level hierarchical structure.
Setting up the “Add to segment” component
The Add to segment component is used to automatically add users to segments. A user is added to a segment when, while interacting with the bot or receiving a broadcast, they reach this component.
This component also allows you to create new segments without going to the Segments section.
Let’s look at how to select a segment from existing ones.
1. In the bot builder, add the Add to segment component to a screen.
2. Click the Segment name field to select one of the segments you created earlier.
Done.
Creating a new segment through the component
If you haven’t created any segments yet, you can create a new one directly here. To do this, click the Segment name field and enter a new name in the search field.
After that, a new field will appear: Create segment (your new segment name will be shown here). Click it to finish. As a result, a new segment will be created in your bot.
To create a parent segment together with a child segment, enter the segments using a hyphen and a greater-than sign:
Parent segment -> Child segment
Through the component, you can also create a more complex structure. For example:
Students → Paid for the course → Completed lesson 1 → Completed lesson 2 → Completed lesson 3 → Completed lesson 4 → Completed lesson 5 → Completed lesson 6 → Completed lesson 7 → Completed lesson 8
If needed, click Add another segment and select the next segment from the ones you have already created, or enter a new one.
If you want to remove an unnecessary segment field, click the X on the right side of the Segment name field.
Setting up the “Remove from segment” component
The Remove from segment component is used to remove users from specific segments you select, or from all segments. The removal happens automatically when a user reaches the Remove from segment component.
1. In the bot builder, add the Remove from segment component to a screen.
2. Select Remove from several if you need to remove users from specific segments. Then, in the Segment name field, choose the required segment.
3. To remove a user from another segment, click Remove from another segment and select the next segment for removal.
If you select a parent segment, the user will be removed from all child segments.
Adding users to segments using variables
The Segment name field is compilable, which means users can be added to a segment via a variable.
When adding users via variables, the segment must already exist. If the segment has not been created yet, it will not be created from the variable, and users will therefore not be added to any segment.
If the segment has already been created, add a Assign variables action in the bot builder, define a variable name, and set the segment name as its value.
In the example below, we first add the user to the parent segment Students — we store a variable with the value Students, and then pass it into the Add to segment component.
Next, we create a second variable. In its value, we enter a nested structure: Students → Enrolled in the course. This variable is also passed into the Add to segment component as the segment name.
As a result, a user who passes through this screen will be added to the parent segment Students and the child segment Students → Enrolled in the course.
When using variables, you should only output the segment you want to add the user to.
For example, you may have a three-level segment structure, but the user only needs to be added to the parent segment Students and to Paid for the first lesson.
To do this, you need to store the parent segment and the third-level segment in variables, and then pass them into the **Add to segment** component via variables:
As a result, the user will be added to the Students segment and to the Paid for the first lesson segment. They will not be included in the **Enrolled in the course** segment.
To add users to the **Enrolled in the course** segment, you need to create a new variable with the value Students -> Enrolled in the course, then add another segment in the Add to segment component and pass this third variable.
Segment names in variable values and segment names in the Segments section must match exactly. If there is any typo or inaccuracy, the user will not be added to the segment.