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

Hello App Indexing

ymnder
June 23, 2017

Hello App Indexing

Otemachi.Firebase#2 2017/6/23

ymnder

June 23, 2017
Tweet

More Decks by ymnder

Other Decks in Programming

Transcript

  1. Hello App Indexing :)
    2017/6/23 Otemachi Firebase #2

    View Slide

  2. whoami
    Ryo Yamazaki / Application Engineer
    twitter: @ymnd
    github: @ymnder
    2

    View Slide

  3. product: Android App
    3

    View Slide

  4. topics
    ᶃ What’s App Indexing
    ᶄ Hello App Indexing
    ᶅ App Indexing: Pros/Cons
    4

    View Slide

  5. topics
    ᶃ What’s App Indexing
    ᶄ Hello App Indexing
    ᶅ App Indexing: Pros/Cons
    5

    View Slide

  6. What’s App Indexing
    6

    View Slide

  7. What’s App Indexing
    • Google ݕࡧͱ࿈ܞͯ͠ɺϢʔβʔͷϦϐʔτ཰Λ޲্
    ͤ͞Δ
    • Chrome΍Google Search Appͷݕࡧ݁Ռ͔Β௚઀Ξϓ
    ϦʹભҠͰ͖Δ
    • ϢʔβʔʹΠϯετʔϧޙʹ࠶Ξϓϩʔν͢Δ͜ͱ͕Ͱ
    ͖Δ

    View Slide

  8. Where can I see it: demo

    View Slide

  9. Where can I see it
    • Chrome
    • Google Search App
    • Google Assistant

    View Slide

  10. Why App Indexing

    View Slide

  11. Why App Indexing

    View Slide

  12. Why App Indexing

    View Slide

  13. ͔ͤͬͭͬͨ͘͘ͷʹ
    ͔ͭͬͯ΋Β͑ͳ͍

    View Slide

  14. ΞϓϦʹ࠶๚ͯ͠ཉ͍͠ʂʂ

    View Slide

  15. App Indexing

    View Slide

  16. Who is the target
    • ΞϓϦΛΠϯετʔϧ͚ͨ͠Ͳɺ࢖Θͳ͘ͳͬͯ͠·ͬ
    ͨϢʔβʔɿre-engage
    • ࠓ࢖͍ͬͯΔϢʔβʔɿmore-engage
    • (ΞϓϦΛΠϯετʔϧ͍ͯ͠ͳ͍Ϣʔβʔ)

    View Slide

  17. How effective is that?
    Case study: g.co/AppIndexing

    View Slide

  18. Which device does it work?
    • ChromeΛΠϯετʔϧ͍ͯ͠Δ୺຤
    • API 14Ҏ্Ͱಈ͘͜ͱΛ֬ೝࡁΈ
    • Search AppΛΠϯετʔϧ͍ͯ͠Δ୺຤
    • ஫ҙɿAPI 16Ҏ্Ͱͳ͍ͱΠϯετʔϧͰ͖ͳ͍
    • Google Assistant͕࢖͑Δ୺຤
    • API 23Ҏ্Ͱ࢖͑ΔΑ͏ʹͳͬͨ

    View Slide

  19. topics
    ᶃ What’s App Indexing
    ᶄ Hello App Indexing
    ᶅ App Indexing: Pros/Cons
    19

    View Slide

  20. Hello App Indexing :)
    • App Indexing
    • WebαΠτʹΞϓϦ΁ͷdeeplinkΛઃஔ
    • αΠτΛ։͍ͨͱ͖ʹΞϓϦ͕։͘
    • App Indexing API
    • ΦʔτίϯϓϦʔτ
    • Google Search Appͷݕࡧ݁ՌʹաڈӾཡͨ͠Ξϓ
    Ϧͷϖʔδ͕දࣔ͞ΕΔ
    • ΩʔϫʔυͰΞϓϦͷϖʔδΛҾֻ͚ͬΒΕΔ

    View Slide

  21. Hello App Indexing :)
    • App Indexing
    • WebαΠτʹΞϓϦ΁ͷdeeplinkΛઃஔ
    • αΠτΛ։͍ͨͱ͖ʹΞϓϦ͕։͘
    • App Indexing API
    • ΦʔτίϯϓϦʔτ
    • Google Search Appͷݕࡧ݁ՌʹաڈӾཡͨ͠Ξϓ
    Ϧͷϖʔδ͕දࣔ͞ΕΔ
    • ΩʔϫʔυͰΞϓϦͷϖʔδΛҾֻ͚ͬΒΕΔ

    View Slide

  22. Hello App Indexing :)

    View Slide

  23. Hello App Indexing :)
    • App Indexing
    • WebαΠτʹΞϓϦ΁ͷdeeplinkΛઃஔ
    • αΠτΛ։͍ͨͱ͖ʹΞϓϦ͕։͘
    • App Indexing API
    • ΦʔτίϯϓϦʔτ
    • Google Search Appͷݕࡧ݁ՌʹաڈӾཡͨ͠Ξϓ
    Ϧͷϖʔδ͕දࣔ͞ΕΔ
    • ΩʔϫʔυͰΞϓϦͷϖʔδΛҾֻ͚ͬΒΕΔ

    View Slide

  24. Hello App Indexing API :)

    View Slide

  25. App Indexing

    View Slide

  26. Hello App Indexing :)
    • ΍Δ͜ͱ͸ͨͬͨ̏ͭ
    ᶃαΠτʹΞϓϦΛඥ෇͚Δ
    ᶄϝλλάΛαΠτʹ࢓ࠐΉ
    ᶅΞϓϦʹDeeplinkΛಡΈࠐΉ࣮૷Λ͍ΕΔ

    View Slide

  27. How to connect with your site: web side
    • HTTPSͷ৔߹ & Android SDK Platform 23 or higher
    • Digital Assets Links
    • https:///.well-known/assetlinks.json

    View Slide

  28. How to connect with your site: web side
    • HTTPͷ৔߹
    • Search ConsoleͰWebͱΞϓϦΛඥ෇͚Δ
    • WebͱAppΛҧ͏ΞΧ΢ϯτͰ؅ཧͯͯ͠΋େৎ෉

    View Slide

  29. Play Console

    View Slide

  30. How to connect with your site: web side
    • αΠτʹmetaλάΛ௥Ճ͢Δ
    • custom URL͸ඇਪ঑͕ͩ࢖͑Δ
    package_id scheme host

    View Slide

  31. How to connect with your site: app side

    View Slide

  32. How to connect with your site: app side

    View Slide

  33. How to connect with your site: app side

    View Slide

  34. How to connect with your site: app side
    https://developer.android.com/guide/topics/manifest/data-element.html

    View Slide

  35. How to connect with your site: app side
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recipe);
    onNewIntent(getIntent());
    }
    protected void onNewIntent(Intent intent) {
    String action = intent.getAction();
    String data = intent.getDataString();
    if (Intent.ACTION_VIEW.equals(action) && data != null) {
    //write wonderful codes…
    }
    }

    View Slide

  36. How to connect with your site: app side
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recipe);
    onNewIntent(getIntent());
    }
    protected void onNewIntent(Intent intent) {
    String action = intent.getAction();
    String data = intent.getDataString();
    if (Intent.ACTION_VIEW.equals(action) && data != null) {
    //write wonderful codes…
    }
    }

    View Slide

  37. How to connect with your site: app side
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recipe);
    onNewIntent(getIntent());
    }
    protected void onNewIntent(Intent intent) {
    String action = intent.getAction();
    String data = intent.getDataString();
    if (Intent.ACTION_VIEW.equals(action) && data != null) {
    //write wonderful codes…
    }
    }

    View Slide

  38. How do I test app indexing
    • manifestͷهड़͕߹͍ͬͯΔ͔
    • Android StudioɿAnalyze -> Inspect Code
    • intent͸ਖ਼͘͠௨Δ͔
    • adb shell am start -a android.intent.action.VIEW -d
    "{URL}" {package name}
    • Webʹmetaλά࢓ࠐΜͩͷʹಈ͔ͳ͍
    • Google search಺ͷfetch as googleͰ࠶Ϋϩʔϧ
    • ΋͔ͯ͠͠ɺඥ෇͍ͯͳ͍ϦϯΫΛ։͍ͯΔʁ

    View Slide

  39. Fetch as Google

    View Slide

  40. Check Before Launch
    • First Click Free
    • ΫϦοΫͨ͠ઌ͸ͦͷ··ίϯςϯπΛݟΒΕΔΑ
    ͏ʹ
    • BackButton
    • ̍ͭલͷεΫϦʔϯʹ໭ΔΑ͏ʹ͢΂͖

    View Slide

  41. App Indexing API

    View Slide

  42. App Indexing API is updated……..
    • 10.0.0͔ΒAPI͕େ͖͘มߋ͞Εͨ
    • codelabs
    • ஫ҙ
    • ೔ຊޠͷget started ͸ߋ৽͞Εͯͳ͍
    • https://firebase.google.com/docs/app-indexing/
    android/migrate

    View Slide

  43. App Indexing API is updated…….
    • GoogleApiClientΛ࢖Θͳ͘ͳͬͨ
    • ΦʔτίϯϓϦʔτʹ࢖͏ϢʔβʔΞΫγϣϯͷϏϧυ
    Ϋϥε͕γϯϓϧʹͳͬͨ
    • ϢʔβʔΞΫγϣϯͷߋ৽ํ๏͕มΘͬͨ
    • ΠϯσοΫεʹΞΫγϣϯ͕௥Ճ͞Ε͍ͯΔ͜ͱΛ֬
    ೝ͔ͯ͠ΒΞοϓσʔτΛߦ͏

    View Slide

  44. App Indexing API is updated……
    // Before
    import com.google.android.gms.appindexing.Action;
    import com.google.android.gms.appindexing.AppIndex;
    import com.google.android.gms.common.api.GoogleApiClient;
    // After
    import com.google.firebase.appindexing.Action;
    import com.google.firebase.appindexing.FirebaseUserActions;
    import com.google.firebase.appindexing.Indexable;
    import com.google.firebase.appindexing.builders.Actions;

    View Slide

  45. App Indexing API is updated…..
    // Before
    import com.google.android.gms.appindexing.Action;
    import com.google.android.gms.appindexing.AppIndex;
    import com.google.android.gms.common.api.GoogleApiClient;
    // After
    import com.google.firebase.appindexing.Action;
    import com.google.firebase.appindexing.FirebaseUserActions;
    import com.google.firebase.appindexing.Indexable;
    import com.google.firebase.appindexing.builders.Actions;

    View Slide

  46. App Indexing API is updated….
    //Before
    public Action getAction() {
    Thing object = new Thing.Builder()
    .setName(mText)
    .setUrl(mUrl)
    .build();
    return new Action.Builder(Action.TYPE_VIEW)
    .setObject(object)
    .build();
    }
    // After
    public Action getAction() {
    return Actions.newView(mText, mUrl);
    }

    View Slide

  47. App Indexing API is updated…
    //Before
    public Action getAction() {
    Thing object = new Thing.Builder()
    .setName(mText)
    .setUrl(mUrl)
    .build();
    return new Action.Builder(Action.TYPE_VIEW)
    .setObject(object)
    .build();
    }
    // After
    public Action getAction() {
    return Actions.newView(mText, mUrl);
    }

    View Slide

  48. App Indexing API is updated..
    //Before
    @Override
    protected void onStart() {
    super.onStart();
    mClient.connect();
    AppIndex.AppIndexApi.start(mClient, getAction());
    }
    @Override
    protected void onStop() {
    AppIndex.AppIndexApi.end(mClient, getAction());
    mClient.disconnect();
    super.onStop();
    }

    View Slide

  49. App Indexing API is updated.
    // After
    @Override
    protected void onStart() {
    super.onStart();
    FirebaseAppIndex.getInstance().update(getIndexable());
    FirebaseUserActions.getInstance().start(getAction());
    }
    @Override
    protected void onStop() {
    FirebaseUserActions.getInstance().end(getAction());
    super.onStop();
    }

    View Slide

  50. Codelabs
    • https://codelabs.developers.google.com/codelabs/app-indexing/#0

    View Slide

  51. topics
    ᶃ What’s App Indexing
    ᶄ Hello App Indexing
    ᶅ App Indexing: Pros/Cons
    51

    View Slide

  52. App Indexing: Pros
    • ΞϓϦ΁ͷ࠶๚ͷػձ͕૿΍ͤΔ
    • Google AssistantͰߋʹ઀৮ػձ͕૿͑ΔՄೳੑ͕ʁ
    • ΞϓϦΛ࢖ͬͯ΋Β͏ػձ૿΍ͤΔ
    • ΞϓϦͰ࠷ߴͷମݧΛ

    View Slide

  53. App Indexing: Pros
    • ϞόΠϧͷݕࡧϥϯΩϯάΞϧΰϦζϜʹӨڹ
    • ܭଌͷڧԽ
    • ϞόΠϧαΠτ๚໰ऀͷΞϓϦΠϯετʔϧ཰ਪܭ
    • SearchConsole

    View Slide

  54. App Indexing: Cons
    • ΞϓϦΛΠϯετʔϧͯ͠ͳ͍ͱભҠ͠ͳ͍
    • re-engageࢪࡦ
    • fallback͸ͳ͍
    • Πϯετʔϧಋઢ͸૿͑Δ͚Ͳɾɾɾ
    • Կނ͔ΞϓϦ͕։͔ͳ͍৔߹͕͋Δ
    • ൓өʹϥά͕͋Δ

    View Slide

  55. App Indexing: Cons
    • ChromeʗSearchAppҎ֎ͰӾཡͨ͠৔߹͸ભҠ͠ͳ͍
    • twitter: App Card, facebook: App Links

    View Slide

  56. Grow App with App Indexing

    View Slide

  57. ͓ΘΓ

    View Slide

  58. References
    http://qiita.com/mmusasabi/items/fd35037aecc1772dd11b
    http://qiita.com/nein37/items/3b69f85b97d0883eb1ca
    http://inside.pixiv.net/entry/2014/12/15/152113
    http://stpsysdev.blogspot.jp/2016/02/androidappindexing.html
    https://www.youtube.com/watch?v=CwgWOHgHHJE
    https://www.youtube.com/watch?v=pl1-m8tJDmQ
    http://thebridge.jp/2015/11/what-is-appindexing
    https://realm.io/news/juan-gomez-android-app-indexing/
    http://www.slideshare.net/wjarek/an-introduction-to-deep-linking-and-app-indexing-codelab
    http://stackoverflow.com/questions/31512465/app-indexing-with-ampersand-in-deep-link-not-working
    https://productforums.google.com/forum/#!topic/webmaster-ja/HdEAWX-YbsE;context-place=topicsearchin/
    webmaster-ja/category$3Aapp-indexing%7Csort:relevance%7Cspell:false

    View Slide

  59. References
    • First Click Free
    • https://support.google.com/news/publisher/answer/
    40543?hl=ja
    • https://productforums.google.com/forum/#!topic/
    webmaster-ja/TRvgIx3Sr2k;context-
    place=topicsearchin/webmaster-ja/category$3Aapp-
    indexing
    • BackButton
    • https://webmasters.googleblog.com/2014/04/app-
    indexing-updates.html

    View Slide