In our Plug sample series, we have another simple yet efficient plug for your Codeless bot builder. Before that, I have a question. Let's say you go to the same coffee shop everyday for your morning coffee. Wouldn't you be happy if the waiter greeted you by your name and remembered what you usually order? Not just you, that would be the case for everyone. And that includes your customers too.
Similarly, when the visitor lands on your website and your chatbot is greeting them. They might not want to enter their names to the bot every time they visit. So to avoid redundancy you can use the following plug for the Zobot to remember the visitor name and scale-up your customer service experience. Plugs
in the Codeless bot are used to create custom functions to achieve customizable actions for your no- code bot. Now let's learn how to create a plug to remember your website visitor name and email address and add it in the chatbot flow built with Codeless bot.
What can this Plug do?
- When a visitor/customer visits your website, they will give their such as name and email. These details will be saved in SalesIQ (Visitor information).
- This plug can prevent asking the name when it is already available in visitor info/visitor variable.
How to create this Plug?
- In your SalesIQ Dashboard, navigate to Settings > Developers > Plugs > Click on Add .
- Provide your Plug a name, description, select the Platform as SalesIQ Scripts and click on Create Plug.
- Click on Parameters, provide the following
- Input Parameter: name | Data Type: String
- Output Parameter: message | Data Type: String
Copy, paste the below code and make the required changes.
- name = "";
- name = session.get("name").get("value");
- returning_message = "Yes " + name + ", can you please let me know your issue?";
- response = Map();
- return response;
- Then, click Save, preview the Plug and Publish it.
How to add this Plug in Codeless bot builder?
- Navigate to Settings > Bot > Add, provide the necessary information, select Codeless Bot as a bot platform, or open an existing bot.
- Select the Plugs under Action Block and choose the required Plug (Only published plugs will be listed here)
- Select "Name" in the visitor variable as the Plug input and provide a context variable for the output.
- After, click Save.
Working of the Plug in Codeless bot:
The Plug has 2 cases, success and failure.
- Success case - When the Name is available in the visitor variable (Name = visitor name), the bot will consider the visitor as returning visitor and will not ask the name again.
- Failure case - When the name is unavailable (Name = null), the bot will ask the visitor the name.