Custom widget in Python using Dialogflow chatbot for WooCommerce site

27 April 2023

next article
Slava Nahnybida

PR manager

Slava Nahnybida
Custom widget in Python using Dialogflow chatbot for WooCommerce site

The use of chatbots in business has become commonplace, significantly affecting customer conversion from any source where an automated assistant works. Special attention should be paid to the site here, because today it is the main and publicly available platform for displaying your company's offer on the Internet. After all, not all users like social networks, not everyone likes to use messengers; and interacting through the official site is a completely normal practice for any user.

In this case, a good solution would be to place a widget on the website that will attract the attention of every visitor and is equally convenient to use from a desktop, tablet or smartphone. Integrating a widget with a chatbot will make communication with customers much easier and faster and will be beneficial to both your company's employees and site visitors for the following reasons:

● the chat bot works 24/7/365 and is fully capable of fulfilling all sales duties assigned to it;

● the bot provides customers with exactly as many opportunities as necessary for high-quality sales or providing comprehensive advice;

● many users find it more comfortable to communicate with a robot than with a live person and much more.

So, when the decision to use a chatbot is made, it is necessary to decide which software will perform its functions. Today, the offer can be extremely wide: from completely custom scripts to services that provide ready-made chatbots for use. And here, according to the Avivi team, you should pay attention to Dialogflow, which is rapidly gaining popularity in the world, has flexible APIs, is convenient and clear to use, and is generally one of the best ready-made solutions from Google in the world. Avivi's customers share the same opinion, for which our developers implemented effective custom functionality and integration with Dialogflow.

Prerequisites of the project

At the time of Avivi's meeting with clients, their website already had a widget that needed a complete reorganization. First of all, Dialogflow was supposed to be the software component for communicating with customers. Secondly, the company's employees needed tools to monitor the operation of the widget and the ability to intervene in the dialogue with the client in case of urgent need. The basic tasks of the new chatbot include the automated sale of three products of the customer company and receiving payment through the Stripe payment system , which requires additional integration. In the future, the customer's employees can completely independently manage the number of products for sale and "teach" the Dialogflow chatbot to recognize requests from customers.

It is worth adding that our customers use the site on WooCommerce - the world's most popular e-commerce platform that uses the open source Wordpress. To combine all the components of the future project together, a custom solution is needed, the effectiveness of which is fully achievable with the capabilities of the Python programming language. Avivi's many years of experience in the implementation of eCommerce projects, combined with excellent knowledge of Python and implementation of integrations contributed to the creation of an optimal technical task, which involves the development of all necessary software.

How the solution from Aviv works

The replacement of the former functionality on the customer's website required a completely new development of a whole series of solutions. This list includes:

● Development of a widget for clients;

● Creating a new functionality of the shopping cart inside the chat;

● Widget integration with Dialogflow;

● Creating a semantic base for a chatbot and algorithms for its behavior;

● Integration with the payment system;

● Development of an environment for the administrator (superuser) on the part of customers;

● Development of tools for monitoring the operation of the solution for the customer's employees.

According to the client's wishes, the new widget should not visually differ from the old one. Therefore, Avivi's frontend development repeats the appearance of the widget with certain improvements for user convenience and aesthetic appeal.


The new algorithm for working with a chatbot involves user identification: first of all, the widget will ask the user to enter an email address. No passwords are required - this is not user verification, but the need to understand who is contacting the company. Users who have already communicated with the chatbot will have the opportunity to view the previous message history.

The Dialogflow chatbot processes a large number of possible request options, checks its own database and provides the necessary custom response. After the implementation of the project, the customer can scale the list of chatbot capabilities directly in the working Dialogflow account without contacting the developers.


After choosing the desired product, the customer is directed to the "shopping cart", where he can change the selected products and their quantity. Next is a redirect to the payment page in Stripe, where the sales transaction is completed.


If the client has difficulties or non-standard questions at any of the stages, the chatbot recognizes the out-of-order situation and informs the company manager. In this case, the employee takes over communication with the client in real time. After solving the situation, the person notifies the chatbot about the end of the session and Dialogflow returns to communication.


Company employees can view all branches of dialogues conducted by the chatbot. There is also an administrator role that can see and manage absolutely all data: dialogs, customer accounts, statistical information, etc.

The solution from Avivi works as an application on the server. To place a widget on a web resource, as in other similar cases, you just need to embed a small script in the site page code.

Avivi's new Python functionality is distinguished by well-thought-out logic and high performance. Communication with the chat-bot occurs almost instantaneously and does not require the site visitor to take any special actions or follow complex instructions. All this should contribute to the growth of conversion and improvement of the company's image in the eyes of its customers, which will certainly be reflected in the development of the business. So if you also want to implement Dialogflow or another chatbot in your business processes, the Avivi team is always ready to help!

Similar articles
Apply for a consultation

We will reach out to within 10 minutes