Interactions with an integration

With an integration, end-user interactions are handled for you. You just need to build an agent, optionally implement a webhook, and configure the integration.

This guide shows you how to use the Dialogflow CX Messenger integration to provide a simple text chat user interface for your agent.

Before you begin

If you don't plan on using an integration, you can skip this quickstart.

You should do the following before reading this guide:

  1. Read flow basics.
  2. Perform setup steps.
  3. Perform steps in the Build an agent using flows quickstart guide. Steps below continue working on the same agent. If you no longer have that agent, you can download the agent and restore it.

Setup

To set up unauthenticated access to your Dialogflow CX Messenger agent:

  1. Go to the Dialogflow CX console.
  2. Choose your Google Cloud project.
  3. Select your agent.
  4. Select the Manage tab.
  5. Click Integrations in the left sidebar menu.
  6. Click Connect on Dialogflow CX Messenger.
  7. A configuration dialog opens.
  8. If the integration was previously setup for this agent, you will see embeddable HTML code. Regardless of whether you want what authenticated or unauthenticated, click the Disable... button at the bottom of the dialog, so you can reconfigure the settings in the next step.
  9. Select an Environment.
  10. Select Unauthenticated API.
  11. Select a style.
  12. Optionally restrict domain access.
  13. Click Enable the unauthenticated API.
  14. The dialog will show the embeddable HTML code that can be embedded on your website. Copy this code.
  15. Click Done.

Embed

Paste the embed code you copied above in a webpage on your website. The <script> and <df-messenger> HTML elements should be in the <body> element of your page.

If you are using an authenticated integration, set the oauth-client-id attribute for <df-messenger> to your Oauth client id.

Update any other attributes that require updating.

To allow for responsive layouts, also add the following to your <head> element:

<meta name="viewport" content="width=device-width, initial-scale=1">

Once embedded, you can interact with your agent through the webpage by clicking the chat icon in the lower right corner.

Messenger interface screenshot

Customize

You can customize the appearance and behavior of this user interface in many ways. See the Dialogflow CX Messenger documentation for more information.