Build a Dynamic Welcome Message With Dialogflow Webhook Fulfillment and Actions on Google.
Let’s have a look into how you can create custom dynamic Welcome messages for your Google Assistant with Dialogflow and Actions on Google.
First open your Dialogflow Console.
Create a new Intent with the following settings: Intent name: [bot-first-greeting]
Events: Choose Google Assistant Welcome
Training Phrases: Empty
Fulfillment: Enable Webhook call for intent Click Save.
For the code I am using Google Cloud functions. Please see also my previous post.
Your Google Cloud Function could like this:
; |
Click the Fulfillment menu item, and make sure the URL points to your Google Cloud function. Assuming that you linked the Actions on Google already in the Integrations tab; move back to your Actions on Google simulator, and refresh your app. When you start your Google Assistant app, it will greet you, based on the time of the day.
Obviously, this is a simple example, but this can become more interesting, when loading profile information or previous contexts before starting your app.