Get Started

To get public and personal content from your app into users’ search results in the Google app, start by setting up your app URLs and adding the Firebase App Indexing library.

Add Firebase and the App Indexing library

Although you don’t strictly need Firebase to get your app's public content indexed by Google, the App Indexing API can help you get more out of Search.

  1. Add Firebase to your Android project.
  2. To add the App Indexing library to your project, go to your app's build.gradle script and add the following dependency:
    dependencies {
      ...
      // To avoid errors, use the same Firebase SDK version across your app.
      compile 'com.google.firebase:firebase-appindexing:11.6.0'
      ...
    }
          

Structure links to your app content

Structure your website and app so the URLs that point to pages on your site are the same URLs that point to views in your Android app. Google Search crawls your site for these links, then uses them to send users directly to your app.

For example, consider the simple http://www.recipe-app.com website from the App Indexing codelab. The links in the app are the same HTTP URLs used on the website and follow a clear structure that matches page types to app view types. Follow this type of structure in your app and website.

The recipe-app.com sample has two page types (for recipes and notes), but you could have many more page types on your site, each with a distinct link type. For example, recipe-app.com includes the following link types:

  • Recipe Pages: http://www.recipe-app.com/recipe/*
  • Note Pages: http://www.recipe-app.com/recipe/*/note
  • But it could also include Cooking Class pages, using the following link types:

  • Cooking Class Registration Page: http://www.recipe-app.com/registration
  • Cooking Class Schedule Page: http://www.recipe-app.com/schedule

Note that personal content added to the on-device index does not need a corresponding webpage. To learn more about adding personal content to an on-device index for appearance in autocomplete suggestions and In Apps searches, see Enable Personal Content Indexing.

To streamline your work, understand the number and types of links you'll need to support before you start building your app. Also make sure you create good titles and descriptions for your pages.

Once you've defined your structure and start creating screens in your app, remember that you also need back navigation. Users should return to the previous screen if they tap the back button after opening a link.

Add Android App Links to your app

For both public content included in Google Search results and personal content included in Google's on-device In Apps search, handle links to your app through Android App Links. Android App Links help you make sure users land in the right place when they open a link to your app. Users that don't have your app installed can also run your app without installing it through Android Instant Apps.

Android App Links include two major components:

  1. Deep links to your app content: Add intent filters to your manifest to define the HTTP URL mapping you set up in the step above, then configure your app to use data from the intents to send users to the right content. Learn more in Create Deep Links to App Content.
  2. Link verification: Configure your app to request link verification, confirming ownership of both your site and your app. Then, publish a Digital Asset Links file to your website that verifies your ownership. Learn more in Verify App Links.

The App Links Assistant in Android Studio walks you through the process outlined in the Android App Links documentation. Learn more about using the App Links Assistant.

Next: Refine Public Content Indexing

Send feedback about...

Need help? Visit our support page.