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:10.0.1'
      ...
    }
          

Support 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 wesbite.

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

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 to provide proper back navigation. Users should return to the previous screen if they tap the back button after opening a link.

Next: Enable Public Content Indexing

Send feedback about...

Need help? Visit our support page.