Building Advanced Chatbots using Google Dialogflow

Written by Mustafa Ali

Data Engineer

Chatbots are ubiquitous when it comes to the modern online experience. From the ELIZA program of 1966 to today, chatbot capabilities and functions have grown in leaps and bounds. In this article, we will be discussing how to build a price recommendation chatbot from scratch. In addition, to discuss the benefits for customers and retailers for utilizing this chatbot.

What is a Chatbot?

In a sentence- It’s a software application that uses AI (Artificial Intelligence) and NLP (Natural Language Processing) to interact with humans and extract the context to understand what users want. Thus, it is a technology that meets the nexus of Artificial Intelligence and Human-Computer Interaction (HCI).

What is Google Dialogflow?

It’s an NLP (Natural Language Processing) platform used to build conversational applications in different languages on mobile apps, web applications, devices, bots, and interactive voice response systems.

Why Would We Need to Build a Price Recommendation Chatbot?

Both sellers and customers are the primary targets of this chatbot. Customers interested in purchasing a product will get insight into which site is more expensive or cheaper. They can also find out on which platform if the product is sold at a discount. Ordinarily, sellers face difficulty getting competitive insights on the optimal product price for each platform to attract more customers. However, they can’t just investigate every product price. This chatbot will help them to get a price on which they can generate more revenue.

For sellers, picture this instance. You are a t-shirt designer who wishes to sell on a popular online retail platform. With the help of this chatbot, you ask what the best price is to sell the t-shirt, and the chatbot can provide the average cost of shirts and the average discounted price of the shirts. Thus, this chatbot will help many independent creators and sellers of online retail products. It can also help e-commerce sites keep track of the price of certain goods across platforms. Competitor research for online companies just got a whole lot easier!

Recipe for Building the Chatbot

  • Use the conversation data (if present) to understand the kind of questions people ask.
  • Analyze accurate answers to those questions through a “training” period.
  • Use NLP & machine learning to learn context and continuously get better at answering those questions in the future.

Benefits of Implementing the Chatbot

Constantly improving the customer experience is a big challenge for a marketing and sales team. Customers want exact answers immediately without error. Thus, the expectations from a chatbot are very high, and we want the chatbot agent to be as accurate as possible. These are some of the key benefits for retailers if they were to use this chatbot:

  • Increase their conversion rate – Marketers put a lot of work to drive traffic to their website, only to have a traffic conversion rate of 0.25%-1.0%. This chatbot could help in driving up the online traffic to their websites significantly.
  • Generate more qualified leads – It would be nice to talk to every lead and ensure they’re really interested in buying the product before the client starts losing interest. Unfortunately, that is not possible for most companies to do at scale. Bots can use advanced qualification logic to do lead qualification and improve sales acceleration.
  • Combat Customer Churn – Bots are an all-in-one solution to high-volume support inquiries, particularly where customers get frustrated with standard knowledge bases that are hard to sift through.


Working and Implementation

With this chatbot, the information on price recommendations will have high accessibility and availability. Here are the following steps:

  • Users can interact from multiple platforms like Google Assistant and Facebook messenger using various devices such as Google Home, Laptops, Mobiles, etc.
  • An example of the request:
  • On Google Assistant, the consumer or retailers can directly ask: “Best price to sell the shirt on Purchase Valley.”
  • On Facebook, the retailer will have the bot installed on their website, and the person can get in touch with the bot to find out the price-relevant information of the desired product/s.
  • This request will invoke Dialogflow intent, followed by Cloud function on the GCP backend.
  • To get updated data, our cloud function will send a request to SheetDB, which creates an API endpoint of our Google Sheet.
  • We write a Python scraper to update the Google Sheet that will scrape data from multiple E-commerce sites.
  • To automate that scraper, we create a Cron job on WayScript, which will trigger Python Scraper Script.

Dialogflow will take care of NLP model training using machine learning to understand customer context more accurately.

How Can Royal Cyber Help?

With the help of this chatbot, online retail search is about to become much more accessible. As a partner of Google Cloud, we have certified AI/ML and data specialists who are enthusiastic about helping your business realize its innovative potential. With the help of technology such as the one mentioned above, we can change the way online retail business is conducted. Read more to learn about how we can help E-commerce platforms and our special take on why HCL Commerce and Google Cloud would be the best match. For more information, you can email us at [email protected] or visit

Leave a Reply