Botsquad documentation logo

The filter control

In the analytics, inbox and contacts section, it is possible to filter the results using the filtering control.

filter_control

In this input box, you can build sophisticated expressions to filter the results of the analytics, the conversations or the user list. These filters allow you to gain more insight into how your users interact with your bot.

Tag filtering

Using tag:tagname you can limit the results to the given tag.

Wherever you see a tag in the Inbox or the Contacts section of the studio, you can click on it to set the current filter to that tag. Additionally, you can press alt while selecting the tag to “and” the clicked tag to the current filter, or press ctrl (command on Mac) to “or” the clicked tag to the current filter. Additionally, pressing alt + ctrl/command simultaneously while clicking, adds the tag using the “and not” operators, which is convenient way to analyze a conversion funnel dropoff point.

Using text:sometext you can limit the results to the users that have sometext in their name or in their email address. For example:

Using quotes, you can search for strings containing spaces:

Note: currently, only the first_name, last_name and email fields of the user are considered in the fulltext search.

Specific field filters

You can set filters on any field that has been remembered. Furthermore, you can filter on the following fields from the user:

These fields can be used in combination with the operators ==, != and =~

Examples:

Combining filters

The and, or, not keywords can be used to combine filters.

Examples:

Predefined filters

If you use some filters frequently, it might be convenient to save these for later use, by you or a team member:

filter_control

In order to do so, you can create a YAML script called user_filters in your bot, which should contain filter definitions, where each entry has a label and a filter expression:

- label: "Engaged visitors"
  expr: "tag:engaged and tag:success"
- label: "Returning visitors"
  expr: "tag:again"
- label: "Failed sessions"
  expr: "tag:engaged and not tag:success"

When you have defined such a file, the above dropdown menu will appear next to the filter input, that shows each defined entry and allows you to select it quickly.