Hide

Set Up Your Website with Android Deep Links

For those pages of your website that correspond to your app, you should indicate alternate content available from your Android app with deep links. This helps Google Search display the right content for mobile users searching for you content using the Google App or the Chrome browser. There are three ways to indicate this relationship:

  • Use a <link> element in the the <head> section of a page.
  • Use an <xhtml:link> element in the Sitemap <url> element specifying the page.
  • Use Schema.org markup for the ViewAction potential action.

Read more about the specification for these methods in the Supported Deep Links reference.

Define and test app URIs

The app deep links you provide through one of the methods above specifies an alternate URI that can be used to open the content in your app from a web page. It helps to first collect and define the page-to-app mappings, making sure you use the correct format for the app URIs:

android-app://{package_name}/{scheme}/{host_path}

Definitions:

  • package_name: application ID as specified in the Android Play Store.
  • scheme: the scheme to pass to the application. Can be http, or a custom scheme.
  • host_path: identifies the specific content within your application.

Let's say the package ID for the example.com app is com.example.android. The following table shows both web and custom scheme URIs along with the target app URI.

Source URL Target "android-app" URL
http://example.com/gizmos?1234 android-app://com.example.android/http/example.com/gizmos?1234
http://example.com/gizmos/1234 android-app://com.example.android/http/example.com/gizmos/1234
http://example.com/gizmos/toys/1234 android-app://com.example.android/http/example.com/gizmos/toys/1234
example://gizmos?1234 android-app://com.example.android/example/gizmos?1234
example://gizmos/1234 android-app://com.example.android/example/gizmos/1234
example://gizmos/toys/1234 android-app://com.example.android/example/gizmos/toys/1234

Test the format of your android-app:// URIs with our deep link test tool.

Allow access by googlebot

When Google indexes content from your app, your app will need to make any HTTP request that it usually makes under normal operation. However, these requests will appear to your servers as originating from Googlebot. If you do not use a robots.txt file to restrict crawling access, your content will be accessible by googlebot. However, if you do have a robots.txt, make sure it's configured to allow access by Google:

  User-Agent: Googlebot
  Allow: /

The app's behavior should not change because it or your server detects Googlebot. Consider network calls made from your app with Googlebot to be from a valid user.

Next, you need to connect your app to your website to let Google know that your app is the official app for your website.

Send feedback about...

App Indexing