Actions on Google

Build bots for the Google Assistant and reach users through 400M+ devices including smart speakers, phones, cars, TVs, headphones, and more.

Here's a simple bot for testing with Actions on Google: https://github.com/meya-ai/voice-bot

Setup

  1. Go to the Integrations tab and select Actions on Google.
460
  1. Click the Create a project URL link.
  2. Click Add/import project. Enter a name and select your region from the drop-down menu. Click Create Project.
  3. Click the gear icon near the top left corner of the Actions on Google console and select Project settings.
510

Click the gear icon to access your project settings.

  1. From the Actions on Google integration settings page in your bot's dashboard, click the link to access an authentication token that will allow Meya to manage your Actions on Google project. Paste it in the Authentication Token text box.
1184

Click the link to generate an authentication token.

  1. Save your integration settings.
  2. In the Actions on Google console, click Overview and select App information, then Edit.
  3. Give your app a name. This name will be used to invoke your app (e.g. "Okay Google, talk to MyApp"). Copy-paste the name into the Pronunciation field, or use your voice to indicate the pronunciation.
  4. Expand the Details section and fill out the Assistant app introduction, Short description, and Full description fields. This is also where you can choose one of four voices to represent your bot.
  5. Expand the Images section and upload a banner and logo.
  6. In the Contact details section, enter your email address.
  7. Under Privacy and consent, enter a URL link to your privacy policy.
  8. Expand the Additional information section and choose a category your bot best fits from the Category menu.
  9. Click Save.
  10. Click Simulator from the left side of the screen. Choose Change Version near the top of the page, and choose an option from the drop-down menu. Click Done. This refreshes the simulator after having made changes to the settings.

Testing your bot

In the simulator, type Talk to <APP_NAME>, replacing <APP_NAME> with the name you set in Step 8 above. Google Assistant should respond Sure. Here's the test version of <APP_NAME>. How your bot responds depends on whether or not you have a flow that uses the start_voice_chat trigger.

561

If no flow uses the start_voice_chat trigger, your bot will respond I'm sorry, I don't understand, or whatever default message you set in your Actions on Google integration settings in your bot's dashboard.

If a flow does use the start_voice_chat trigger, your bot will launch the flow.

Fallback messages

From the Actions on Google integration settings page, you can set a default message that will be displayed to the user if your bot is unable to understand the user's input.

You may also set a timeout message that will be displayed when your bot takes too long to respond. Action on Google requires a response within 4-5 seconds. Long-running components can result in timeouts occurring.

423

Surface capabilities

The type of surface, or device, the user is interacting with appears in the user scope: {{ user._integrations.google_actions.surface }}. The options are

  • phone
  • speaker
  • smart_display

In addition, the surface's capabilities are available on user scope:

  • {{ user._integrations.google_actions.capabilities }} for the full list of capabilities.
  • {{ user._integrations.google_actions.supports_account_linking }}
  • {{ user._integrations.google_actions.supports_browser }}
  • {{ user._integrations.google_actions.supports_screen }}
CapabilityDescription
actions.capability.SCREEN_OUTPUTThe device has an output display screen.
actions.capability.AUDIO_OUTPUTThe device has a speaker.
actions.capability.MEDIA_RESPONSE_AUDIOThe device supports playback of media content.
actions.capability.WEB_BROWSERThe device supports a web browser.
actions.capability.ACCOUNT_LINKING

You can use this information to design different interactions optimized for the user's surface.

states:
    choose:
        component: meya.text_suggestions
        properties:
            text: |
                Welcome to Meya's Google Assistant demo.
                I see you are using a {{ user._integrations.google_actions.surface }}.
                What would you like to see?

What’s Next

Now that you've connected your bot to Actions on Google, take some time to explore the nuances of voice-controlled bots by building a simple bot.