User Segments
Segmenting your Users
As your chatbot audience grows over time, you will often want to start seperating your users into groups for various reasons. The most obvious use for this is when sending broadcasts, you may want to send a message to some of your users (say users who have purchased from your before) and not to others. But there are many other reasons you may want to divide your users into groups (segment them). Perhaps you have a bot with both paid content and free content, and you only want some areas of your chatbot to be available to your paid users. Or you may want to segment your users based on the specific products they have purchased.
For all these use cases and more, you can use the Flow XO user segments feature to neatly divide your audience up into as many different groups as you need, and then use those segments to send broadcasts only to a subset of users, or restrict which flows can run for various segments or combination of segments.
This article is divided into several sections:
- Managing user segments
- Creating/Removing Segments
- Adding users to segments
- Manually in the user profile
- As part of your flows using flow actions
- Using segments
- Controlling which segments a particular flow will apply to (including broadcasts)
- Reacting to changes in segment membership1. Managing User Segments
Before you can start using segments in Flow XO, you'll need to create some segments that you can enroll your users into. This is done in the Users area of the application:
The user segments interface allows you add the segments you will be placing your users into. Here, you can use the "New Segment" button to add a segment, or delete old segments that you no longer need. Note that deleting a segment simply removes it from view when creating new segment rules.
Adding users to segments
Now that you have some segments, you'll need to start enrolling your users. There are several ways to do this. Usually, you will enroll your users in segments inside your flows, based on metadata about the user or based on if they take certain actions. We'll cover that in a moment. But there are two other ways you can add users to segments: manually, and via the API. To understand how to add and remove your users from segments via API, see this article. To add or remove users from segments manually, navigate to a users profile:
From here, you can add and remove segments from any given user using the dropdown.
Adding users to segments from within a flow
Usually, you will add and remove users from segments based on their user attributes, or based on their activity within your bot. To do that, you will need to use the Add Segments to Remove from Segments flow tasks:
Both of these actions are configured the same way:
You can add or remove a user from up to 5 segments at once (but only one is required).
When this spot in your flow is reached, the current user will be enrolled (or un-enrolled) from the configured segments.
Viewing Segment Membership
Once you have some users in various segments, you may want to see which users are in which segments. For that, you can use the "Segment" filter on the user list:
2. Using Segments
Putting your users into segments is interesting, but it's not tremendously useful on its own. For segments to be truly useful, you need to be able to use them to either narrow down your audience for a broadcast, or alter the behavior of your bot by choosing which flows should execute for which segments. For both purposes, you can use the segment filter of a flows configuration. For this example, we'll use a broadcast flow, but this same technique works for ANY flow. Once a flow has segment conditions configured, the flow will only execute for users that match those conditions. Let's create a broadcast for our VIP Users segment.
In this example we'll use an instant broadcast, but the segment conditions work on every broadcast type (as well as regular non-broadcast flows):
Now we need to click the "Edit" icon on the segment conditions so we can create some segment rules:
Next, we will add some rules to decide which users should be part of the broadcast:
In this example, we're selecting VIP users, but excluding VIP users in our Website Users segment. Keep in mind that ALL of your segment conditions must be met for a flow to execute.
Once configured, you can easily see what segment conditions are configured for a flow. Here we can see that this broadcast will match every user that is in the VIP Segment, except users that are in the Website Users segment.
If we send the broadcast, we can see that the broadcast audience only includes a subset of our users that match these conditions:
Reacting to changes in segment membership
Another way to use segments is to trigger a flow for a user when they enter or exit a particular segment. You can use this feature to send a welcome message to users that "subscribe" to a particular list, or you could use an HTTP task or a CRM integration to update your CRM with their segment membership, or you could even send an e-mail or a text message to users to enter or leave a particular segment. Anything that a Flow XO flow can do can be triggered when a users segment membership changes. To set this up, create a new flow, and use an "Added to Segment" trigger or a "Removed from Segment" trigger:
Here you can choose the segment that should cause this flow to run when a user is added to it. If you leave the "Segment" field blank, the flow will run when a user is added to ANY segment.
In this example we're just sending the user a simple message when they are added to VIP Users, but of course you can do anything you like in the flow:
Managing Segments via API
In addition to all of the tools shown in this article, you can also enroll and unenroll users from segments using our API. This is handy if you want to bulk-update users segment memberships from an external database, or you want to add or remove users from segments from within your own software or integrations. You can read about how to do that here: https://support.flowxo.com/article/285-creating-a-user-via-api
That's it for now! Let us know at support@flowxo.com if you have any questions or feedback on how to make best use of segments in your chatbots. Happy flowing!