Trigger and match type

Match type

A trigger is something that activates the bot, change states, or perform another action. The words in the "Trigger" field act as a trigger for the workflow in the builder to execute the event or action contained within the block.

Tirggers control the flow of the conversation. They are configured in the "Trigger" field within a conditional block or on a connection arrow.

  • Format: A trigger can be a symbol, number, regular expression, or specific keyword.

  • Action: When a user's input matches a defined trigger, the bot executes the associated workflow, such as advancing to a new funnel state or triggering an action.

For example, if you need to create a block for all possible messenger start words, you can specify the following condition: start;start;get started;start

The chatbot will respond to the trigger by executing the specified action or event; for example, it might send a welcome message to the client:

To recognize a trigger, you need to define the comparison type (the "Match Type" field). The match type helps the chatbot compare the condition to the client's message or another action (such as a button click) and determine which event to trigger next.

In MaviBot, there are five types of condition matching:

  1. Fuzzy match;

  2. Keyword match;

  3. RegEx match;

  4. Exact match;

  5. Semantic search.

Let’s take a closer look at each of them.

Fuzzy match

This is the primary comparison type, allowing the bot to handle misspellings, typos, inaccuracies, missing letters, and letter rearrangements. The condition is triggered if the similarity between strings is greater than 70%.

Example: For the condition "hello", the following variations would trigger a match: "hlelo", "hellp", "helo", and so on.

This type of comparison is more user-focused and takes the human factor into account when processing conditions, as typos are quite common.

The "Fuzzy" match type is ideal for the welcome (initial) block in a chatbot flow, where the client is the one to initiate the conversation.

Keyword match

Keyword match is a very powerful comparison type that helps create a human-like consultant. With this type of matching, the bot will respond to any user message that contains at least one of the condition’s keywords.

In other words, if the client sends a message containing one or more keywords from the condition, the flow will trigger according to its settings.

Example: For the condition "hello;person," the following message would trigger it: "I want to greet this wonderful person."

You can include a large number of keywords in the condition. This allows the chatbot to recognize what the client needs at the moment and trigger the appropriate event configured within the block.

As seen in the example above, the bot will respond to any message that contains at least one of the keywords in the condition. This match type also uses the field "Ignore triggers" (messages that should not trigger a response).

This field works similarly to the condition field but with the opposite effect: if the user’s message contains any words from the "Ignore triggers" field, the condition will not be triggered.

Accordingly, if the condition in the "Ignore triggers" field is met, the overall condition will not work.

Variability

You can add an additional trigger separated by a semicolon, but what if you need to match one of several word options?

For example, to handle phrases like "My internet is not working," "My computer is not working," or "My computer broke," with a single trigger.

Obviously, listing all keyword variations one by one is not practical. That’s why the OR syntax was created. To specify one of several equivalent keywords, place them all inside parentheses and separate them with a vertical bar (|).

For example, the trigger (tar plan|tariff) (pereit|podklyuch|menit|pomen) will match questions like: "Hello, how do I connect a new plan?" "How do I change my pricing plan?"

Let’s break down the trigger: (tar plan | tariff) means the string must contain “tar” AND “plan” OR “tariff” AND at the same time one of the words: “switch” OR “connect” OR “change” OR “replace”.

Here are some other intuitive examples:

  • change password (cab|pa) ("cab" and "pa" are short for "cabinet" and "personal account")

  • (forgot|reset|restore|remember|accepts|fits|incorrect|not the right|don’t remember) password

  • (can’t|unable to) (restore|change) password

  • login in contract; (lost|loss|where is|don’t know|where|can’t find|no) contract

  • (suspend|blocked|block|disconnect) (services|internet|inet|charged); (saved|save) day; put on pause; leaving

  • auto payment; payment; pay; recurring payment; connect payment

Exact match

With this type of comparison, the bot will trigger the event only if the client’s message exactly matches the condition.

The comparison is case-insensitive, meaning that if the condition is "hello" and the user types "HELLO," the condition will still be triggered. This should be taken into account.

This type of comparison is suitable for use in settings like connections when a client clicks a button or transitions from a mini-landing page to the chatbot with a specified site tag.

  1. For button clicks: For example, in the conditions, we specify the names of the buttons that, when clicked by the client, should lead them to the corresponding block.

Next, we will create the blocks to which the client should be directed after clicking the button following the first block. There should be four of them:

Next, in the arrow settings, we enter the button name and set the match type to "Exact match."

Now you can test the bot:

As you can see, the bot correctly processes the condition and the exact match selection when using buttons.

  1. Using a site tag in the funnel:

In this case, the principle is similar to using buttons; however, the condition and match type are set directly within the conditional block itself.

Here, the tag is taken from the Sites tab, where you have installed the tag for the website page:

The tag in the block’s condition is specified directly in the block’s CONDITION field without using the words “TAG” or any other labels.

For more details on how to set up the bot trigger using a tag installed on the website, see the article "Creating a Website and Basic Settings" in the "Tag" section.

The chatbot will also respond and execute the configured event within the block’s settings.

RegEx match

RegEx match is a type of condition that allows the bot to check the format of the entered data (for example, to verify that the user has entered a phone number and not something else).

During data collection, users often enter information that differs from what was requested. Here is a typical example of a phone number validation flow. If the user enters something other than a valid phone number, the bot will prompt them to try again.

From the block requesting the phone number, two connections lead out:

  1. One connection without a trigger

  2. Another connection with a regex trigger for validating a phone number

^(\+)?((\d{2,3}) ?\d|\d)(([ -]?\d)|( ?(\d{2,3}) ?)){5,12}\d$

The connection with a trigger adds the phone number to the request and will only trigger when a valid phone number is detected. The second connection will trigger in all other cases, as it has lower priority.

To complete list of useful regular expressions can be found in the article with the same name.

The "Semantic search" option is based on artificial intelligence — a real breakthrough for your chatbot.

How it works:

  • The trigger contains words or phrases representing the MEANING that the AI will identify in the client’s message.

  • The system (chatbot) processes the client’s message by searching for the meaning embedded in the condition within the client’s input.

  • The bot then triggers the corresponding event in the block.

In other words, by specifying certain phrases or values in the condition, the AI checks each condition against the client’s message and triggers the relevant event in the block (for example, sending a message, etc.).

Example:

We specified particular phrases and keywords for the AI to detect in the client's message to trigger the relevant event within the block.

In our case, the trigger includes phrases related to "closing accounts or contracts."

When using the "Semantic search" option, the bot should find words or phrases in the client’s message that are similar in meaning to those specified in the condition:

Each time the bot processes a client’s message, it correctly triggers the required event defined in the block.

How to write a trigger Thetrigger is entered in the corresponding field just like other conditions for any match type: separated by semicolons (;).

It’s best to specify phrases or words in the trigger field as accurately and concisely as possible.

Thus, using the "Semantic search" option, the AI will analyze various possibilities to understand the meaning of the client’s message and, based on the match, the chatbot will trigger the appropriate event.

Trigger builder

The Trigger is a unique, specialized feature designed for quick creation of triggers within the corresponding blocks to respond to incoming callbacks from various channels, payment systems, and other integrations.

Accordingly, the trigger builder is available only for blocks that support triggers:

To use the trigger builder, open the block settings where you will see the corresponding button located just above the condition field:

After clicking the corresponding button, a window for working with conditions will open:

MaviBot triggers

The "MaviBot Triggers" tab in the trigger builder includes all system conditions that are stored and available for use across various sections in MaviBot.

Default triggers This functionality works similarly to nested conditions within a block: here you specify conditions that are NOT pre-built into the system. This can be a funnel tag, a site tag, or any other condition that exists only in your project.

Variables

Triggers with variables are quite easy to set up.

Step 1. Enter the variable name in the appropriate field.

Step 2. Choose the comparison parameter.

In other words, specify what you want to compare your variable with: a specific value or another variable.

Step 3. Select the comparison type.

Each comparison has its meaning: equal to (==); not equal to (!=); strictly greater than (>); greater than or equal to (>=); strictly less than (<); less than or equal to (<=).

Example:

In the example, the variable’s value is set to be greater than or equal to 21. What does this mean? It means that the event within the block will trigger only for clients who belong to the "adult" age group — that is, those who are either 21 or older.

The expression "age >= 18" is equivalent to "age > 17."

The condition "age > 17" will also trigger only for those strictly older than 17, i.e., starting from 18 and above.

MaviBot sections

In the MaviBot sections conditions, there are typical callbacks — system notifications — about various events in the project.

To trigger an event within a block based on system notifications, set the required callback in the condition field, then select the match type and click the "Add condition" button:

After that, the condition will appear in the corresponding fields within the block.

Messengers

The condition builder in channels helps not only to track reactions to posts or publications but also to trigger events within blocks for the chatbot’s response.

Payment

Step 1. To set up conditions for payment systems, make sure you have connected the corresponding integration; otherwise, you won’t be able to use the condition builder with the required system.

Step 2. Next, click on the payment system you need.

Step 3. Select the appropriate callback.

Step 4. Then enter the payment amount in the corresponding field and click "Add condition." The last step is to write the appropriate message in the block settings:

Last updated