Click here to see your recently viewed pages and most viewed pages.

Add app deep links on your website

Each page on your site can specify whether its contents should be loaded in your app. We offer several ways to tell Google about the relationship between a web page and a deep link to your app:

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

Using the App Indexing API can also surface your app's history in the Google app query autocompletions.

Format of the app URIs

This <link> element specifies an alternate URI (specified in the href attribute) that can be used to open the content in your app. The format of the app URI is:



  • 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 app is Following are deep links and what the app URI would be for each.

Deep link App URI android-app:// android-app:// android-app://
example://gizmos?1234 android-app://
example://gizmos/1234 android-app://
example://gizmos/toys/1234 android-app://

If you would like to test to see if your android-app:// URIs are formatted correctly, please use our deep link test tool.

Now let's see how you can add these app URIs to your web pages or sitemaps.

In the HTML of the page, you add a <link> element as follows for the deep link

  <link rel="alternate" href="android-app://" />
<body> … </body>

Or, if you're using a non-HTTP scheme (e.g., example://gizmo), you would add the following:

  <link rel="alternate" href="android-app://" />
<body> … </body>

You can also annotate the relationship between a page and how to open it in your app using <link> elements in your website's XML Sitemap. For example:

<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns=""
  <xhtml:link rel="alternate" href="android-app://" />
</urlset> markup for ViewAction

You can also use markup in the open standard to define your app as a handler for the ViewAction potential action. This tells Google (and anyone else supporting markup) how to deep link into your app. For example:

<script type="application/ld+json">
  "@context": "", 
  "@type": "WebPage", 
  "@id": "", 
  "potentialAction": {
    "@type": "ViewAction", 
    "target": "android-app://"

Update robots.txt

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. Therefore, your server's robots.txt file must be configured properly to allow these requests. For example, your robots.txt file could include the following:

  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, learn how to implement the App Indexing API to have your app content surfaced in the Google app query autocompletions.