The [Google Home app (GHA)](https://play.google.com/store/apps/details?id=com.google.android.apps.chromecast.app)
is the primary way users connect smart devices to
Google Assistant and assign them to structures and rooms in
[Google Home Graph](https://developers.home.google.com/cloud-to-cloud/primer/home-graph.md.txt).
To perform setup, users typically click through multiple screens to find your
Cloud-to-cloud integration from a list of available options. By
making it easier for users to begin the setup process, you can help onboard
them more quickly and reduce user setup frustration.

Deep Linking allows you to embed a deep link in your app or product website for
users to easily connect their smart home device to
Assistant. Clicking on the link prompts users to download
the GHA (if not already installed), and launches the
account linking and room assignment setup flow.

## Deep link to Google Home

Deep links enable you to take users directly to a specific destination within
the [GHA](https://play.google.com/store/apps/details?id=com.google.android.apps.chromecast.app) from your Android or
iOS app, simplifying the device setup process.

To initiate account linking directly in the GHA, use the
following Universal Link:

    https://home.google.com/home-app/?deeplink=setup%2Fha_linking%3Fagent_id%3Dagent-id

Where <var translate="no">agent-id</var> is the Project ID of your Cloud-to-cloud
integration, which you can find in the
[Google Home Developer Console](https://console.home.google.com) under project settings.

For mobile applications launching using a custom scheme (Android and iOS), you
can also use:

    googlehome://setup/ha_linking?agent_id=agent-id

> [!NOTE]
> **Note:** If an organization manages multiple Agent IDs across separate product lines, ensure the deep link specifies the corresponding `agent-id`.

When users click the Universal Link, the mobile platform checks for the presence
of the GHA and opens the account linking flow. If the
GHA is not installed on the user's device, provide
fallback handling to route the user to install or update the app from Google
Play or the Apple App Store.

### Android explicit intent

To trigger the account linking flow directly from your Android application
using an explicit intent:

```kotlin
val intent = Intent(Intent.ACTION_VIEW).apply {
    val agentId = "YOUR_AGENT_ID"
    data = Uri.parse("googlehome://setup/ha_linking?agent_id=$agentId")
    setPackage("com.google.android.apps.chromecast.app")
}
try {
    startActivity(intent)
} catch (e: ActivityNotFoundException) {
    // Fallback: open Google Play app, with web browser safety
    try {
        val playStoreIntent = Intent(Intent.ACTION_VIEW,
            Uri.parse("market://details?id=com.google.android.apps.chromecast.app"))
        startActivity(playStoreIntent)
    } catch (e: ActivityNotFoundException) {
        val playStoreUrl =
            "https://play.google.com/store/apps/details?id=com.google.android.apps.chromecast.app"
        val webIntent = Intent(Intent.ACTION_VIEW, Uri.parse(playStoreUrl))
        startActivity(webIntent)
    }
}
```

### Legacy deep links

Legacy deep link URLs formatted with `madeby.google.com` or
`assistant.google.com` are deprecated:

    https://madeby.google.com/home-app/?deeplink=setup%2Fha_linking%3Fagent_id%3Dagent-id

Update all in-app buttons and product websites to use the Universal Link
or the `googlehome://setup/ha_linking` custom scheme.

For more details on triggering deep links from within your app, see the relevant
[Android
documentation](https://developer.android.com/training/basics/intents/sending)
and [iOS
documentation](https://developer.apple.com/documentation/xcode/allowing_apps_and_websites_to_link_to_your_content).