Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deep linking via Google Search - how it works, and what to put in the manifest?

Background

I need to investigate how to integrate with the new (?) Google search deep linking feature.

The problem

This seems like a relatively new feature that's still not so popular, so I can't find a lot of resources about how it works and how to configure it correctly.

What I've tried

I've read some websites of Google and watched some of its videos:

  • https://www.youtube.com/watch?v=kYLrK-gD2Yg
  • https://www.youtube.com/watch?v=UjLJoMWSXts
  • https://developers.google.com/app-indexing/webmasters/app
  • https://support.google.com/googleplay/android-developer/answer/6041489
  • https://developers.google.com/app-indexing/webmasters/appindexingapi
  • https://developers.google.com/app-indexing/
  • https://plus.google.com/+AppIndexing/posts
  • http://googlewebmastercentral.blogspot.co.il/2014/06/android-app-indexing-is-now-open-for.html

from what I understand, I need to register the app, change the data (intent handling) in the manifest for an activity, and change the code of the activity too, but I'm not sure I understand how it all works and what's the best way to configure it.

The questions

Even after that much reading, I would still like to ask some questions about deep linking using Google Search:

  1. First, the basic question, to verify that I know what it's all about: It lets apps to be indexed via the "Google Search" app, but those apps must be installed too. Once the user clicks an item within "Google Search" app, it goes to your app and you get the query. Is this correct? Is there anything more than that?

  2. They wrote that minSdkVersion should be 17 or below (here). How come it's "or below" instead of "or above" ?

  3. For some reason, the query of the examples (like here) are of just simple texts, but the app is shown there. Why is it shown? What in the manifest tells Google-Search that the app can handle this query? The code examples show URLs ...

  4. Is it possible to test the deep linking via Google Search without registering it (here) ? All I've found is how to test it via adb, but I don't understand where in the example (here) is the query that the user enters.

  5. Do the deep linking require an actual website that users can visit via the web browser ? I ask this because there is a step called "Verify website" when registering to the service (here) .

  6. Suppose I want to allow the user to search for a phone number via the app. Should I put "tel:" in the "scheme" (as shown here) part inside the manifest? Or is it something else(or more than that)? Would Google-Search know exactly when to show the app (for example, when the phone number is valid)?

  7. Is it possible to use this feature in case the app isn't installed, so that it would encourage people to download the app, and/or search via a real website?

  8. Even when trying to test it, I've failed. Manifest:

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <!--should match to : https://somehost/search/?number=-->
            <data android:scheme="https"
                  android:host="somehost"
                  android:pathPrefix="/search/?" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>
    

code:

    Intent intent = getIntent();
    String action = intent.getAction();
    Uri data = intent.getData();
    Log.d("AppLog", "action:"+action+" data:"+data);

adb command (from here) :

adb shell am start -W
-a android.intent.action.VIEW -d "somehost/search/?050" com.example.user.myappli
cation
Starting: Intent { act=android.intent.action.VIEW dat=somehost/search/?050 pkg=c
om.example.user.myapplication }
Error: Activity not started, unable to resolve Intent { act=android.intent.actio
n.VIEW dat=somehost/search/?050 flg=0x10000000 pkg=com.example.user.myapplicatio
n }

I've even tried the exact sample, but with a different package name, and it still didn't work.

What's wrong here?

like image 993
android developer Avatar asked Apr 26 '15 11:04

android developer


People also ask

What is deep linking and how does it work?

Deep links are a type of link that send users directly to an app instead of a website or a store. They are used to send users straight to specific in-app locations, saving users the time and energy locating a particular page themselves – significantly improving the user experience.

What is deep linking in Google ads?

Deep links send mobile device users directly to relevant pages in your app rather than your website. Users click on ads and go directly to your app pages. You can use deep links in many Google Ads products, including App campaigns for engagement, App dynamic remarketing, and Search, Shopping, and Display campaigns.

What is deep linking example?

In the context of the World Wide Web, deep linking is the use of a hyperlink that links to a specific, generally searchable or indexed, piece of web content on a website (e.g. "http://example.com/path/page"), rather than the website's home page (e.g., "http://example.com").


1 Answers

  1. Google Search app and google.com in Chrome as well. User needs to be signed-in. If app is installed, clicks will deep link to your app.

    • If the app is not installed, participating in App Indexing can help drive installs: http://googlewebmastercentral.blogspot.com/2015/04/drive-app-installs-through-app-indexing.html

    • Also, an indexed app is considered "mobile-friendly" which is a ranking signal. Look for "finding more mobile friendly search" on the same blog.

  2. If your minSdkVersion is 15, 16, 17 that's okay. If it's 18, then that's not okay.

  3. If your app is indexed by Google, deep links to your app can appear in Google Search results for users that have your app installed. Google learns about your app's supported deep links when you tell Google about these links via website markup, your sitemap, or by connecting your website. Look for "Provide Deep Links" in the app indexing documentation.

  4. In order to see what queries your content could show up for, go to the new Search Console (g.co/searchconsole) and sign in. Then, you need to look at what sort of traffic your website is getting from Google and what impressions and clicks your content is getting for what queries. If your app supports the same links and you've provided these app deep links to Google, then these are the same queries your app deep links should show up for.

  5. For App Indexing, website is required -- need to tell Google mapping from a web URL to an app deep link, either through sitemap, website markup, or by verifying your website. But if you do either a sitemap or markup, you don't need to verify your website. If you're just talking about your app supporting deep linking, a website is not required for that.

  6. You can use whatever scheme you want for your deep links, so I would guess that tel: should work (though haven't tried it myself). However, Google won't automatically know when to show this phone number until you've provided a mapping to your web content. See #3.

  7. Yes. As of April 2015 this is now possible. See link in answer to #1.

  8. Some suggestions:

    • In the manifest file, make path prefix "/search".
    • For adb command, try specifying your link as "https://somehost/search"

If that doesn't work, it's possible you need to enter a website for your host, i.e. you need a domain. If that's not what you want to do, just create a custom scheme for testing purposes, e.g.

    <data android:scheme="example"
          android:host="gizmos" />
like image 141
Lawrence Chang Avatar answered Oct 23 '22 01:10

Lawrence Chang