Upgrade to Pro — share decks privately, control downloads, hide ads and more …

App Indexing - Index your app content for search‎

App Indexing - Index your app content for search‎

By default, Google shows users install buttons for your app. App Indexing then plays a key role as a ranking signal for how your app appears, both when the user has your app installed and when she doesn't. This helps you increase your install base and keeps your users coming back.

Chintan Rathod

April 30, 2016
Tweet

More Decks by Chintan Rathod

Other Decks in Technology

Transcript

  1. What is Deep Linking? • Linking to specific part, page

    or state of mobile app • Send the user to a richer experience
  2. Checklist for Intent Filter • Add Intent Filter to Android

    App • Add Code to handle Intent • Test Intent Handler
  3. Add Intent filter to app Accept URIs begin with http://gdg.darshan.ac.in/schedule

    <activity android:name=".YourActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host=“gdg.darshan.ac.in" android:pathPrefix="/schedule" android:scheme="http" /> </intent-filter> </activity>
  4. Handle Intent @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.your_activity);

    Intent intent = getIntent(); String action = intent.getAction(); Uri data = intent.getData(); TextView txtOutput = (TextView) findViewById(R.id.txtOutput); txtOutput.setText( "Action : " + action + "\n Data : " + data.toString())); }
  5. Testing Intents adb shell am start -a android.intent.action.VIEW -d http://www.gdg.darshan.ac.in/schedule

    chintan.rathod.appindexingdemo adb shell am start -a android.intent.action.VIEW -d <URL_TO_CALL> <PACKAGE_NAME>
  6. Checklist for Website Markup • Apply URL format of Deep

    linking • Add links to Header tag • Add links to Sitemap • Add links to Schema • Verify Website in Webmaster console
  7. Apply links in Header tag <head> ... <link rel="alternate" href="android-app://com.example/gdg/www.gdg.darshan.ac.in/schedule

    " /> ... </head> <head> ... <link rel="alternate" href="android-app://com.example/gdg/www.gdg.darshan.ac.in/schedule" /> <link rel="alternate" href="ios-app://123456/gdg/www.gdg.darshan.ac.in/schedule" /> ... </head>
  8. Add links to XML Sitemap <urlset xmlns=http://www.sitemaps.org/schemas/sitemap/0.9 xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url> <loc>http://www.gdg.darshan.ac.in/schedule</loc>

    <xhtml:link rel="alternate" href="android-app://com.example/gdg/www.gdg.darshan.ac.in/schedule" /> <xhtml:link rel="alternate" href="ios-app://123456/gdg/www.gdg.darshan.ac.in/schedule" /> </url> ... </urlset>
  9. Add links in Schema <script type="application/ld+json"> { “@Context” : "http://schema.org",

    “@type” : "WebPage", “@id” : "http://www.gdg.darshan.ac.in/schedule", “potentialAction” : { “@type”: "ViewAction", “target”: " android-app://com.example/gdg/www.gdg.darshan.ac.in/schedule“ } } </script>
  10. Checklist for App Indexing API • Why App Indexing API?

    • Add Google Play services • Add App Indexing API calls • Indicate the app activity
  11. What is App Indexing API? The App Indexing API takes

    a history of actions to your app, such as TYPE_VIEW for static content or TYPE_WATCH for video playback. It sends that history to our systems along with content fields that you provide, such as titles and descriptions. This enables query autocompletions for your app users, as well as richer search results, improved Search quality, and enhanced ranking signals. Users can view and delete past activity in apps at https://history.google.com/.
  12. MainActivity.java (2) public class MainActivity extends Activity { private GoogleApiClient

    mClient; private Uri mUrl; private String mTitle, mDescription; @Override protected void onCreate(Bundle savedInstanceState) { mClient = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build(); mUrl = "http://examplepetstore.com/dogs/standard-poodle"; mTitle = "Standard Poodle"; mDescription = "The Standard Poodle stands at least 18 inches at the withers"; } public Action getAction() { …. } }
  13. public Action getAction() { Thing object = new Thing.Builder() .setName(mTitle)

    .setDescription(mDescription) .setUrl(mUrl) .build(); return new Action.Builder(Action.TYPE_VIEW) .setObject(object) .setActionStatus(Action.STATUS_TYPE_COMPLETED) .build(); } MainActivity.java (3)
  14. MainActivity.java (4) @Override public void onStart() { super.onStart(); mClient.connect(); AppIndex.AppIndexApi.start(mClient,

    getAction()); } @Override public void onStop() { AppIndex.AppIndexApi.end(mClient, getAction()); mClient.disconnect(); super.onStop(); }