There are cases where you want your customers to land to a live chat agent directly, instead of making them go through the complete bot flows and eventually reach a dialog where they could choose to talk to an agent.
We could accomplish this by using the Custom Params (also called GetClientParams) in chatbot builder. This is applicable both on a webpage or a web view in a mobile app where the bot script has been embedded.
- Navigate to the required Bot where you would like this param to be added.
- Then click on the ‘Custom parameters’ option from the right page.
- Using the ‘New Parameter’ option, create a new JS parameter and the ‘Save in’ should be ‘Customer Details’.
Lets name it LiveAgentOrBot.
Make sure that you provide a name or a value to the pages where you have embedded the bot script in your Mobile app or webpage.
Note: These two values are the ones that would be passed into the JS param, and that is what would decide to which flow the user would be taken to.
From the same ‘Custom Parameter’ page, use the ‘Generate Script’ option to get the new bot script which will now have the newly added JS param. Embed this bot script on the mobile app or webpage.
Create a new private dialog in the existing Bot flow with the following logical conditions:
If ‘LiveAgentOrBot’ - Equals - Value1
GoTo - (choose the dialog where you have configured the action of assigning the chat to a live agent)
Else - (Choose the regular flow in the Bot where your users should be taken to)
Note: Custom Params added as ‘Customer Detail’ will not appear under the ‘Custom Param’ section in the conditions. You have to select Placeholder ->Customer’s Extra Information, and then add the name of the param, for example, LiveAgentOrBot in our case.