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

App Indexing: Blurring the Lines Between Your Website and App

Juan Gomez
November 20, 2014

App Indexing: Blurring the Lines Between Your Website and App

You worked really hard to create a great Android app that provides a better experience for users accessing your content from their mobile devices. And yet most of your users still find themselves on your website being sent there by a Google search or a link they clicked on in an e-mail or another app (like the browser).

Don’t you wish there was a way to send those users back to your app instead?

Well, there is a way to do this, and it’s called App indexing. App Indexing allows you to connect pages from your website with specific content within your Android app. This enables users who have your app installed to open it directly from relevant mobile search results on Google.

Juan Gomez

November 20, 2014
Tweet

More Decks by Juan Gomez

Other Decks in Programming

Transcript

  1. App Indexing
    Blurring the Lines Between your App and your Website
    Juan Gomez

    View Slide

  2. Intro
    Who am I?
    • Mobile Engineer at Netflix
    • Previously at Eventbrite and OneLouder Apps
    • Android & Python Developer

    View Slide

  3. Agenda
    • Implementing Deep Linking on your App
    • Including your app in the App Indexing Program
    • Surfacing your app’s content on Search
    Autocomplete.

    View Slide

  4. Why deep linking?

    View Slide

  5. Deep Linking Checklist
    1. Identify deep links
    2. Add Intent Filter to Android App
    3. Add Code to Handle Intent Filter
    4. Test Intent Handler

    View Slide

  6. Identify Deep Links
    http://www.eventbrite.com/e/the-great-dickens-christmas-
    fair-5-weekends-one-friday-tickets-11925103305

    View Slide

  7. 1. In your AndroidManifest.xml file, add one or more
    elements for the activities that should be launchable from deep links.
    2. Add an tag that specifies the ACTION_VIEW intent action.
    3. Add a tag for each data URI format the activity accepts. This
    is the primary mechanism to declare the format for your deep links.
    4. Add a for both BROWSABLE and DEFAULT intent
    categories.
    • BROWSABLE: is required in order for the intent to be executable
    from a web browser.
    • DEFAULT: declares your app can accept an implicit intent. (not
    required if you’re only providing deep links from Google Search
    results)
    Add Intent Filter to Android App

    View Slide

  8. Add Intent Filter to Android App

    View Slide

  9. Add Code to Handle Intent Filter

    View Slide

  10. Test Intent Handler
    Or you can use this website:
    https://developers.google.com/app-indexing/webmasters/test
    Using ADB on the command line:

    View Slide

  11. Success!

    View Slide

  12. The downside of deep linking?
    The evil chooser dialog!

    View Slide

  13. App Indexing Checklist
    1. Create URL format for App Indexing
    2. Add App Indexing Markup to your website
    3. Verify your website on Webmaster Tools*
    4. Connect your app using Google Play Console
    * if your website/page is brand new.

    View Slide

  14. URL format for App Indexing
    android-app://com.eventbrite.attendee/http/www.eventbrite.com/e/the-
    great-dickens-christmas-fair-5-weekends-one-friday-tickets-11925103305

    View Slide

  15. • For each of the deep links identified earlier, we
    need to add additional markup.
    • This markup allows the Google crawler to use deep
    links to send users to your Android app.
    • For most modern web application frameworks, this
    should only involve changing a single template.
    Add App Indexing Markup

    View Slide

  16. Add App Indexing Markup

    View Slide

  17. Verify Your App in Webmaster
    Tools (for new websites)
    • Go to Google Webmaster Tools.
    • On the left menu, click All Messages.
    • Open the verification request message (example:
    "Google Play: Link http://www.yourwebsite.com to
    Android application com.yourpackage.name").
    • Click Approve the request.
    • Review the information in the dialog.
    • Click Approve

    View Slide

  18. Verify Your App in Webmaster
    Tools

    View Slide

  19. Connect your app using
    Google Play Console
    • Sign in to your Google Play Developer Console.
    • Click All Applications
    • Select the application you'd like to verify.
    • On the left menu, click Services & APIs.
    • Under "App Indexing from Google Search", click Verify
    website.
    • Type your website address.
    • Click Verify.

    View Slide

  20. Connect your app using
    Google Play Console

    View Slide

  21. Search results should now go straight to your app.
    Success!
    (for real this time)

    View Slide

  22. Adding Search Autocomplete
    1. Implement App Indexing
    2. Verify Google Play Services Version
    3. Create an API Client
    4. Record a Page View
    5. Record a Page View End
    6. Test

    View Slide

  23. Verify Google Play Services
    • The next thing we need to do is make sure that Google Play
    Services is enabled for our app.
    • The App Indexing API requires Google Play Services version 5.+
    • minSdkVersion 10 or above.
    • If using selective API on GPS: 

    com.google.android.gms:play-services-appindexing:7.0.0

    View Slide

  24. Create an API Client

    View Slide

  25. Record a Page View

    View Slide

  26. Record a Page View End

    View Slide

  27. Test Autocomplete

    View Slide

  28. Summary
    • Use deep linking to redirect traffic from the web to
    your app
    • Implement App Indexing to allow Google search
    result to send users directly into your app (and not
    your website)
    • Use the App Indexing API to expose content from
    your app in Google’s query autocomplete.

    View Slide

  29. Useful links
    • https://developers.google.com/app-indexing/
    • https://www.youtube.com/watch?v=Xh_W82JgOms
    • https://www.youtube.com/watch?v=UjLJoMWSXts

    View Slide

  30. Thank You!
    Twitter: @_juandg
    Email: jgomez@netflix.com
    Lanyrd: lanyrd.com/profile/juandg/

    View Slide