Link to your Actions (Dialogflow)

You can generate a URL that will link directly to the specific Action, on a per-Action basis. Users who click the Assistant link (previously called Action links) in a web or mobile browser will be directed to the Assistant on their device, where they'll interact directly with your corresponding Action.

Some examples of useful Assistant links include:

  • Linking users to voice-guided instructions from a how-to website.
  • Linking users to a customer support experience from a "get help" page.
  • Linking users to an update intent so they can opt-in to your future updates.

To generate a URL for an Action, do the following:

  1. In the Actions Console, navigate to Develop > Actions.
  2. Click the Action you want to generate a link for.
  3. Under the Links section, enable Would you like to enable a URL for this Action.
  4. Enter a Link title. This title should include a verb that is descriptive of what the Action will do. For example, if your Action takes the user down a transaction flow to buy tickets to a concert, a useful link title would be "purchase concert tickets".
  5. Click Save.

You can copy the provided URL and reference it wherever you want to direct users to this specific Action.

Assistant links can optionally contain an intent and parameters in the URL. Google handles the parameters according to the type of intent specified in the URL.

The general syntax for the URL of an Assistant link is as follows:

https://assistant.google.com/services/invoke[/$action_id][?intent=$intent&param.$param=$value][&$utm_param=$utm_value]

The URL parameters you can set are described in the following table:

URL parameter Description
$action_id Action's numeric identifier.
$intent Full name of a built-in or custom intent.
$param Full name of an intent parameter specified in the Action package.
$value URL encoded value of the type declared for $param in the Action package.
$utm_param List of one or more UTM parameter types. Valid values include: utm_source, utm_medium, utm_campaign, utm_term, and utm_content.
$utm_value String value of the UTM parameter.

If the Assistant link contains a built-in intent (the intent starts with actions.intent.*), Google will try to extract any built-in intent parameters in the URL and pass them on to your Action. Any parameters that Google does not understand as built-in intent parameters are stripped.

For conversational Actions, Google sends these parameters to your fulfillment as part of the AppRequest message.

The following example shows how you might specify an Assistant link URL that includes a built-in intent with a single intent parameter:

https://assistant.google.com/services/invoke/uid/0000008ddd7eabec?intent=actions.intent.GET_HOROSCOPE&param.astrologySign=%22cancer%22

For custom intents Google extracts only those parameters that are defined by your Action as part of the intent and discards any other parameters.

The following example shows how you might specify an Assistant link URL that includes a custom intent:

https://assistant.google.com/services/invoke/uid/0000001f575305a0?intent=NEWS_UPDATE_DEEP_LINK&param.topic=sports

For the above example URL, in the AppRequest, Google adds a JSON object as follows:

argument {
  name: ‘topic’,
  raw_text: ‘sports’,
  text_value: ‘sports’,
}

If you don't specify an intent in the Assistant link, Google links to the MAIN intent (actions.intent.MAIN) of your Action by default with the following behavior:

  • If you didn't explicitly enable the MAIN intent in the Assistant link, Google triggers the main intent without any parameters, similar to the behavior for "Talk to app_name".
  • If you explicitly enabled the MAIN intent, Google passes the parameters to your Actions.

The following example shows how you might specify an Assistant link URL with no intent:

https://assistant.google.com/services/invoke/uid/000000d139bbc4d4

UTM parameters are strings that Google sends to your Action when users click on an Assistant link, which you can later use for analytics.

The UTM parameters that Google sends to your Action includes the following:

  • utm_source
  • utm_medium
  • utm_campaign
  • utm_term
  • utm_content

The following example shows how you might specify an Assistant link URL that includes UTM parameters:

https://assistant.google.com/services/invoke/uid/000000d139bbc4d4?utm_source=Google&utm_medium=email&utm_campaign=holiday+sale

For the example URL above, Google adds the following arguments in the AppRequest message:

argument {
  name: ‘utm_source’,
  raw_text: ‘Google’,
  text_value: ‘Google’,
}
argument {
  name: ‘utm_medium’,
  raw_text: ‘email’,
  text_value: ‘email’,
}
argument {
  name: ‘utm_campaign’,
  raw_text: ‘holiday sale’,
  text_value: ‘holiday sale’,
}

You can test Assistant links for any intent (main or custom, with or without parameters) through the simulator or a device.

To test your Assistant link:

  1. Enable the Assistant link in the console.
  2. Sign into the Assistant with the same account you used to create your Actions on Google project.
  3. Create a clickable version of your Assistant link (in email, chat, doc, etc.).
  4. On an Assistant enabled device, click on the link created in the previous step.

Once you confirm the Assistant link functions as expected, you will need to re-deploy your Action to make the link available to your users.

Restrictions and best practices

Because your Assistant link URL can now be distributed and referenced outside of the directory or other Google services, please note that the following restrictions and best practices apply:

  • Make sure you continue to support all of your Assistant links. If you distribute an Assistant link that later breaks, your Actions project may be flagged as unhealthy and taken down.
  • Publishing a link means you support triggering from untrusted sources. For any linked Actions, you must explicitly confirm with the user before taking any "real-world action". For example, an Action that turns off a smart home appliance should prompt the user saying "Are you sure you want to turn off $applianceName?"

    In this context, a "real world action" is any action affecting the user's services, data, devices, networks, computers, or APIs. For example, sending an email, performing a transaction, altering the status of a Smart Home appliance, creating a subscription, or updating a piece of content.