Create agents to manage brands

After you register as a partner, you can enable conversations for brands you manage by creating Business Messages agents for them.

An agent is a conversational entity that users interact with. You create one agent for each brand you manage. You create and manage agents with the Business Communications API, and you control messaging for your agents with the Business Messages API.

An agent encompasses a brand's business functions, such as online support, and physical locations (if any). Each message contains the context from which the user initiated the conversation. Your message routing infrastructure can detect if the user viewed a specific business location or looked for general support, and it can route messages to the correct destination.

The agent/brand relationship

For example, if you manage the Growing Tree Bank brand, which has a website and two locations, you create a single "Growing Tree Bank" agent. Users can encounter the agent through general or location-based searches, and the context in which the user found the agent is passed along with each message to your webhook. You use that context to route the message either to staff at a location or to the website support team, who create a response and continue the conversation with the user.

Expectations

Before you create an agent, understand the expectations of agents on Business Messages.

  • Agents should follow the design guidance outlined in Conversation design for Business Messages.
  • Agents should have human representatives available to answer questions when automation is unable to fulfill a request or when requested by users.

  • Agents should maintain a customer satisfaction rating (CSAT) of at least 80% and a merchant response rate (MRR) of at least 95% as outlined in Metrics.

Create an agent

When creating an agent, you can enable the Business Messages Helper Bot to help you explore the platform. The Helper Bot lets you quickly start a conversation with your agent so you can try out the available features and find resources to help you implement them. This is especially useful when creating your first agent.

To create an agent, you need to gather and submit information about the brand and how you want the agent to appear to users.

If you manage multiple brands, repeat the steps to create an agent for each brand.

Prerequisites

Before you create agents for brands you manage, you need to gather some information:

  • Brand name
  • Agent name

Create the agent

Once you've gathered your information, it's time to create your agent.

  1. Open the Business Communications Developer Console and sign in with your Business Messages Google account.
  2. Click Create agent.
  3. For Agent type, select Business Messages.
  4. Enter values for Brand name and Agent name.
  5. Do one of the following:
    • To experience a conversation with your agent where you can explore the available features, select Enable Business Messages Helper Bot.
    • To customize your agent and prepare it for message handling, deselect Enable the Business Messages Helper Bot.
  6. Click Create agent.

If you enabled the Business Messages Helper Bot, you can start a conversation immediately. Otherwise, proceed to set your webhook.

Set an agent-level webhook

You receive messages sent to your agent at your webhook. If you want messages for a specific agent to arrive at a different webhook instead, you can set an agent-level webhook.

  1. Open the Business Communications Developer Console and sign in with your Business Messages Google account.
  2. Click your agent.
  3. Click Integrations.
  4. For Webhook, click Configure.
  5. For Webhook endpoint URL, enter your webhook's URL, beginning with "https://".
  6. Note your clientToken value. You need it to verify that messages you receive are coming from Google.
  7. Configure your webhook to accept a POST request with the specified clientToken parameter and send a 200 OK response with the value of the secret parameter.

    For example, if your webhook receives a POST request with the following body content

    {
      "clientToken":"SJENCPGJESMGUFPY",
      "secret":"0123456789"
    }
    

    your webhook should confirm the clientToken value and, if clientToken is correct, return a 200 OK response with the secret URL parameter set to 0123456789.

  8. In the console, click Verify.

    When Business Messages verifies your webhook, the dialog closes.

Test an agent

Each agent has test URLs that let you see how a conversation with that agent appears to users and give you the opportunity to verify your messaging infrastructure.

To test an agent,

  1. Open the Business Communications Developer Console and sign in with your Business Messages Google account.
  2. Select your agent.
  3. Under Agent test URLs on the Overview page, choose how to access the test URLs:

    • To access the URLs on your mobile device, click the Android button or iOS button. Then scan the QR code with the corresponding device and click Launch. Alternatively, click Copy Android URL or Copy iOS URL to copy the agent's test URL to your device's clipboard.
    • To send the URLs to your email address, click Send.
  4. Open the URL in your mobile device. (iOS devices require the Google Maps app.)

Update agent information

After you create your agent, you can edit the agent's information on the Agent information page:

  • Brand name
  • Agent name
  • Agent logo (1024x1024 px)

    In conversations, logos display as 1024 px diameter circles. Make sure that your logo displays well as a circle.

  • Phone number

  • Privacy Policy URL

  • Default locale

  • Welcome message

  • Offline message

  • Conversation starters

  • Messaging availability through primary and secondary interactions

The Overview and Agent information pages preview how your agent appears in conversations.

After you verify an agent, you can only update the following fields:

If you need to update other fields after you verify your agent, contact us. (You must first sign in with a Business Messages Google account. To register for an account, see Register with Business Messages.)

Delete an agent

When you delete an agent, Business Messages deletes all agent data. Business Messages doesn't delete messages sent by your agent that are in transit to or stored on a user's device. Messages to users aren't agent data.

Delete requests fail if the agent has an associated location or if you've attempted to verify the agent one or more times. To update locations, see Add locations.

You cannot delete an agent that is verified. To delete an agent that you've verified or attempted to verify, contact us. (You must first sign in with a Business Messages Google account. To register for an account, see Register with Business Messages.)

To delete an agent,

  1. Open the Business Communications Developer Console and sign in with your Business Messages Google account.
  2. Choose your agent.
  3. At the bottom of the Overview page, click Delete agent.
  4. Enter "DELETE", then click Delete agent.

Deleting an agent doesn't delete associated brand data. Use the Business Communications API to delete a brand.

Next steps

Now that you have an agent, you can take the following steps: