Plug Sample #4: Improve your customer interacting experience by letting Zobot remember your website visitor name!

Plug Sample #4: Improve your customer interacting experience by letting Zobot remember your website visitor name!

Hi Everyone! 

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. 

Note: Remember that the visitor information will be stored only after they agree to the privacy policy

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/context variable. 
Note: Learn more about the context variable here

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.
  1. name = "";
  2. name = session.get("name").get("value");
  3. if(name.containsIgnoreCase("Visitor"))
  4. {
  5. }
  6. else
  7. {
  8.  returning_message = "Yes " + name + ", can you please let me know your issue?";
  9. }
  10. response = Map();
  11. response.put("message",returning_message);
  12. 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
Note: The visitor names name will be stored in a context variable. It can be used in other cards to provide more personalization. To avail it, type % and choose "visitor.name". 


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. 
 


Related links:
To know more about the features of Zobot, kindly visit our Resources Section.