Google Search
How to add custom search to your virtual chat agent
Last updated
Was this helpful?
How to add custom search to your virtual chat agent
Last updated
Was this helpful?
It would be much more valuable to have an assistant on your website that actually has knowledge of what information is on your website. With the Google Search skill, the bot will be able to search the website and present the results.
Click on Skills
Click on Browse
Click on Google Search
Click Install
To enable this skill in our bot we need to publish the bot. Click on "Publish".
Now the skill is installed so it can be configured.
Enter your domain name (without http or https)
Choose your language
Give your search engine a meaningful name
Click the create button
Now your search engine is created and you see te following:
Click on the Control Panel button to go to the details of your search engine.
Click on the Copy to clipboard button to copy the Search Engine ID (CX code) to your clipboard.
Go back to the studio and find your installed Google Search engine skill in the Installed Skills section and click on the little wheel icon in the upper right corner of the skill panel.
Paste your Search Engine ID (CX code) in the first box.
Paste your API key in the second box
Click on the Save button
Click on Content
Click on Flows
Open the Unknown flow by clicking on Unknown
Click Add action and unfold this step (click on the header bar of the new action)
Select perform "Invoke"
Select target "Dialog"
Select dialog "site_search"
Now we want this action to be performed before escalating, that is why you need to drag this action to the top of this flow.
Click on the little drag icon (the 8 dots) in front of the action header and hold it. Now move your mouse above and see the row is dragging along. Release the mouse button when you are hovering above the first action of the Unknown flow. Now the action is sorted first. It should look like this:
No click the Save button and try it by running your chatbot in the studio or publish it and try it on your website.
You can easily test the google search feature by running the chatbot in preview mode. Press the play button in the preview panel on the right hand side.
Now type in a query for which you are absolutely sure it can be found on your website and there is no pre-trained answer for it on your website.
Notice that the bot will not provide one or more search results to choose from as if it is a pre-trained answer.
In order to use this skill you need to have a Google API key for the Google Custom Search Engine and a CX code. Google Custom Search Engine is free to use. The skill uses the REST API to integrate with the search engine. Read more about it .
Get a google search engine API key .
Create a Search Engine ID in the search engine using the following explanation:
In order to use the Google Search skill we need to add it to the flow. We want to configure it in such a way that it will execute the google search before escalating.