Google Business Messages

Integration published by Jovo | 505 downloads

Build conversational experiences for Google Maps, Search, and more

Google Business Messages Platform Integration

Learn how to build your Google Business Messages bot with the Jovo Framework.

Getting Started

Google Business Messages allows the user to chat with a business within Google Maps and Search. It is an asynchronous chat platform where businesses can either let a bot answer or a customer service worker. The platform doesn't provide a built-in NLU, so you are free to choose one of the many integrations in the Jovo Marketplace.

Installation

Install the module:

Make sure, that you have a database-integration enabled because this platform needs User-Session Data. You do not have to change the config because GoogleBusiness will enable the feature when it is installed.

Import the installed module, initialize and add it to the app object:

After that, you have to add JSON key of a service account that has access to the Google Business Messages API:

Basics

All of the Google Business specific objects and functions are accessed using the $googleBusinessBot object:

The object will only be defined if the incoming request is from Google Business Messages. Because of that, you should first check whether it's defined or not before accessing it:

LAUNCH and END Intent

Sadly, the Google Business Messages don't provide a separate request to mark the start and end of a session. Therefore, both the LAUNCH and END intent are not usable.

Requests

The integration currently supports two different request types. First, the standard text request:

followed by the suggestion request, triggered when a user clicks on one of the provided suggestion chips:

You can find a detailed explanation for each attribute in the official documentation by Google here

$request

Besides the default request helpers, like getTimestamp(), the integration provides the following ones:

Name Description Return Value
getAgent() returns agent's ID string
getCustomAgentId() returns the agent's custom ID string
getRequestId() returns the request's ID string
getRawText() returns either the value of the message.text or suggestionResponse.text attribute string
getEntryPoint() returns the entry point that the user clicked to initiate the conversation either ENTRY_POINT_UNSPECIFIED, PLACESHEET, or MAPS
getPlaceId() returns the ID from the Google Places database for the location the user messaged. string or undefined
getUserDisplayName() returns the user's display name string or undefined

Responses

Besides the generic text response using ask(), you can also add cards to your responses.

First, the standalone card using the showStandaloneCard(card) method:

The card's object structure is equal to the one described in the official Google documentation here

Second, the carousel card using showCarousel(carousel):

The card's object structure is equal to the one described in the official Google documentation here

Google Business Messages Changelog

Jovo Marketplace | GitHub | npm

Current version might be higher than the latest changes displayed below because of updates of dependencies.

2020-09-01 [3.0.9]

  • #810 Implement check for duplicated messages for GoogleBusiness (@m-ripper)

2020-08-21 [3.0.7]

✨ New Features

  • #803 Implement asynchronous responses for GoogleBusiness (@m-ripper)

💅 Enhancements

3.0.3 (2020-07-21)

💅 Enhancements

3.0.1 (2020-07-21)

  • Initial publish

Committers: 1

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.