How to Add Dialogflow Bot to WordPress Websites
Tags: wordpress, dialogfow, kommunicate, chatbot
Published: 2021-01-24 15:37:55

The chatbots are cropping up and gaining popularity everywhere. It’s also commonplace for chatbots to appear on websites, instead of a user attempting to search your website to find what they need, they can just engage in directions conversation with your chatbot. In this post, we will learn how to add [Dialogflow](https://cloud.google.com/dialogflow/docs/) bot to [WordPress](https://wordpress.org/) websites with the help of [Kommunicate](https://www.kommunicate.io/). If you don’t have Kommunicate account, [signup here](https://www.kommunicate.io/product/dialogflow-integration) for free.

There are two stages one needs to follow to add Dialogflow bot to WordPress websites. We will go through them in detail below. We will use Kommunicate’s chat widget and Dialogflow bot in this article. Both these tools are free to try.

If you don’t have Dialogflow chatbot, please read this step by step guide and build your own chatbot.

Bonus: [Want to build your chatbot without any coding?](https://www.kommunicate.io/blog/how-to-make-a-chatbot/)

#Stage 1: Integrate Dialogflow bot with Kommunicate
Here is the step by step video for integrating Dialogflow bot with Kommunicate. I have also mentioned the steps below.

[https://youtu.be/rOikD16R0pY](https://youtu.be/rOikD16R0pY)

Login to Kommunicate and click on the Bot section. Locate the Dialogflow section and click on it.


Add Dialogflow Bot to WordPress - Kommunicate bots

###Get your Dialogflow API Credentials
After clicking, a setting popup box will open. You will be asked for Dialogflow credentials. By logging into your Dialogflow console, you can obtain these.

Click on the Settings icon (gear icon on the left panel) and choose V2 API as the preferred API version. Save your settings, and follow the setup instructions.

Open Dialogflow agent settings (gear icon on the left panel)
Click on the google cloud link which is mentioned in the google project bar
In the Google, cloud page navigate to Credentials section by clicking on API’s & services
Under the Credentials section find the service account and click on edit for Dialogflow integrations
In the bottom of the screen click on ADD key button and create key option, JSON key will be downloaded
 Now upload the key file.

##Integrate Dialogflow Bot into Kommunicate
Go back to Dialogflow settings screen of Kommunicate, enter your credentials, then click on next to save and progress. You’ll be able to give your bot a name in the user profile section that follows. Your customers will see that name whenever the bot interacts with them.


To integrate Dialogflow CX into Kommunicate follow the same instructions to download the JSON key and mention the Agent Id in the kommunicate dashboard

To get the Agent Id: Go to *Dialogflow CX* console >> Select the Project >> In the Agent you have created ‘Copy the agent name to the clipboard will be in the format mentioned below,  where the Agent Id is 54b0c663-2c01-4a09-a482-277ff39c0b05

![Dialogflow CX](https://dev-to-uploads.s3.amazonaws.com/i/ulkxgou1noliv9pu9t7y.png)

Save, and move to the next steps to complete the setup.


You can check your newly created bot here in the Dashboard →Bot Integration → Manage Bots section.

#Stage 2: Integrate Kommunicate with WordPress
Log in to your WordPress dashboard and click on Plugins from the left navigation panel. Then click on Add New button.

![Wordpress Plugin](https://dev-to-uploads.s3.amazonaws.com/i/k6vrgw4de2h6tzlglnf6.jpeg)


Search for “Insert Header and Footers” plugin. On the search results page, you’ll see many options. Locate the “Insert Headers and Footer’s” plug-in and click the Install Now button. Please make sure you Activate the plugin to make use of it.

![Header and Footer Plugin](https://dev-to-uploads.s3.amazonaws.com/i/73l92fo3ce6ukwhmcoj3.jpeg)

Now, click Settings from the left-hand navigation menu. From the Settings menu, select Insert Headers and Footers. This will open a console for entering headers and footers.

Add Dialogflow Bot to WordPress - headers and footers

###Add the Kommunicate Script
Here you have to paster your Kommunicate script. You will get the same in the Kommunicate dashboard -> Settings -> Install. Insert the copied script in the Script in Footer section of the Header and Footer console. Save the changes.

Add Dialogflow Bot to WordPress - kommunicate script
And that’s it. You have completed the integration. Open the website and check out the chat widget and play around with your bot. You will find it in the bottom-right corner. Now your website visitors can chat effortlessly chat with you. You can manage the conversations and appearance from the Kommunicate dashboard.


##Wrapping Up

Adding live chat to your WordPress websites is as simple as it gets and requires no coding skills or technical expertise. Use the live chat and bots to connect quickly with visitors to your website and with customers.

Suggested Reads – [How to integrate Dialogflow with react js](https://www.kommunicate.io/blog/integrate-dialogflow-bot-react-js/)

[Add Kommunicate AI Chatbot to Wordpress](https://dev.to/devashishmamgain/chatbot-wordpress-3d6l
)