How to integrate Google Assistant with Drupal 8
The demand for Voice technology is rising and it is likely to revolutionize the way publishing websites engage with their audience. The Internet-connected virtual assistant is seeing a significant rise, but the question is how publishers can use this tech to grow their audience base and ultimately increase revenue? Here, we will explore how to use Actions on Google for a new project and an existing one followed up by an integration with Drupal 8 website.
Let’s have a look.
Integrating Actions on Google with a device
Integrating Actions on Google with an electronic gadget or smart speakers allow us to trigger voice command to control various Drupal commands such as:
- Clearing cache
- Count number of node
- Sending an email
- Run external as well as internal cron
- Control Drupal application to respond or insite defined action
- Integrating Google voice assistance with Drupal 8
1->Go to https://console.actions.google.com
- Create new Add/import project.
- Enter your project name and Country /region.
- Add a new project
Create actions on Dialog Flow
- Build a Dialog Flow, you will land to given page as per below screenshot.
- Now create a new intent and enter the following details as shown in the screenshot
Fill below field
- User says
- Response → Default → “voice control text which can speak”
- Select the field of Fulfillment and then save.
- Now click on Fulfillment.
- Enable Webhook
- Enter URL of your controller and save
Module development in Drupal 8
We are creating this module to hit '/ok-google-test’ page and return test reply setup after performing the process.
Create a custom module and a routing file:
Now go to your bot.
You will see the similar screen where you can say clear caches.
With this integration, we can interact with our voice-enabled devices to use various Drupal functionalities, like cache clear, external cron run, sending mail, and others. Hope now you can integrate Actions on Google with your Drupal website. If you have any suggestions or queries please do comment below.
Below given is the presentation on "Integration of Google Assistant with Drupal".