Google Search Integration

Written by Hasan Rizvi
Posted On Dec, 04, 2017
HOW TO SET UP GOOGLE SEARCH: For this set up example we will use Google Search in story. So let’s get started.
  1. Go to the New Story Menu from the side menu.
  2. In the Bot sends block on Plugin button. You will see the following window with google icon on it. Click it. 
  3. After clicking the button another modal will appear. Click on Get Started Button. 
  4. After clicking on get started. You will be redirected below to the following screen. 
  5. The directions to get the API Key and Search Engine ID can be found by clicking “more” link below each field. *Note: When finding Search Engine ID follow step 6 and 7.
  6. By following the instructions you will end up at Google CSE home. Click Add button, you will be redirected to following page: In the Sites to search Field type and name your search engine and click create.
  7. You will be redirected to another page. Click Custom Search Heading there. And then click on your newly created search engine.On the new page, scroll down, you will see drop down against Sites to Search.  Change it to Search the entire web. Now click on Search Engine Id button to get Search Engine Id.
  8. Now for the query select any value from the drop down. Remember the google search will run against the value of query you’ve selected. For Example, {first_name} will be the first name of the user who is chatting with you. We prefer using your own entities or {last_user_msg}.
  WHERE TO USE GOOGLE SEARCH: Consider a scenario where you are creating a bot for FAQ purpose. And you want to setup a story which returns meaning of what user says. For instance, the user says “What is the meaning of chat bot”. So you create a story with keywords and set keywords like meaning, means etc. And against that connect google search plugin with query of {last_user_msg}. Whenever the user types in something with meaning in it. Your bot will search google and bring the first result from it.