Android Ultimate Plugin Tutorial part 10 – App Indexing

Hi Everyone, today we will discuss App Indexing , so what is App Indexing ?

App Indexing helps you get your app found in Google Search. Once your app is indexed, mobile users who search for content related to your app can see an install button to your Android app in Search results. This helps you increase your install base.

App Indexing also helps you keep your users coming back. When mobile users with your app installed search for something relevant to your app content, Search results can link directly to the relevant content in your app. This keeps your customer base engaged.

So let’s Start

First of all you must follow the guides and instructions on this link, without following this link nothing will happen your app will not be index even the Android Ultimate Plugin runs and activated.

https://support.google.com/googleplay/android-developer/answer/6041489

Then after that I will Assumed that you are done doing the setup from the above link

To Activate App Indexing using Android Ultimate Plugin is so easy first you need to setup your Android Manifest file

add this lines on your Android manifest file

<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:scheme="https" android:host="play.google.com" android:pathPrefix="/store/apps/details?id=YOUR PACKAGE ID HERE"/>
</intent-filter>

<!-- Accept adb data flag -->
<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:scheme="https" android:host="play.google.com/store/apps/details?id=YOUR PACKAGE ID HERE"/>
</intent-filter>

after the <intent></intent> inside <Activity android:name=”com.unity3d.player.UnityPlayerNativeActivity” ></Activity>

Note: you need to change the scheme, host and pathprefix on this intent-filter to make google app indexing works.

for more information on how to change the scheme, host and pathprefix see the links below:
https://developers.google.com/app-indexing/android/app
https://developers.google.com/app-indexing/android/server

here’s some example on how we did this on Android Ultimate Plugin Manifest file

<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<!--Google indexing-->
<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:scheme="https"
android:host="play.google.com"
android:pathPrefix="/store/apps/details?id=com.gigadrillgames.androidultimateplugin"/>
</intent-filter>
<!-- Accept adb data flag -->
<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:scheme="https"
android:host="play.google.com/store/apps/details?id=com.gigadrillgames.androidultimateplugin"/>
</intent-filter>
<!--Google indexing-->

<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

Also Don’t forget to add this

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

After we setup Our Android Manifest file, time to do some little bit of coding

First we get the instance of AndroidUltimatePluginController

private AndroidUltimatePluginController androidUltimatePluginController = AndroidUltimatePluginController.GetInstance();

we then now, set the SetDebug to 0 to prevent showing of Debug Toast Messages

androidUltimatePluginController.SetDebug(0);

Then after that we need to initialize it, by calling InitGoogleIndexing() method and passing the required  Application Title, App URL link and Application Web URL

string appTitle = "AndroidUltimatePlugin";
string appPackage = androidUltimatePluginController.GetPackageId();

string scheme = "/play.google.com/store/apps/details?id=";
string appUrlLink = "android-app://" + appPackage + scheme + appPackage;

Note: app url link should follow this format
android-app://{package_name}/{scheme}/{host_path}

//sample app web url you need to change this with your own website url or link inside your website
string appWebUrl = "http://www.google.com";

androidUltimatePluginController.InitGoogleIndexing(appTitle,appUrlLink,appWebUrl);

After we initialized it, we can now start app Indexing by calling StartGoogleIndexing() method

androidUltimatePluginController.StartGoogleIndexing();

Note: just call app Indexing once after  your application or game done loading the initial screen, calling this multiple times violates the Google App Indexing policies. To know more information about this just follow this link and look for best practices

https://developers.google.com/app-indexing/android/appActivity

And Finally to stop App Indexing just call StopGoogleIndexing() method

androidUltimatePluginController.StopGoogleIndexing();

For testing google app indexing read and follow this link
https://developers.google.com/app-indexing/android/test#top

if you are curious and want to know what Android Ultimate Plugin really doing  when app indexing your application, just follow this link and look for  Modify Deep link activities

https://developers.google.com/app-indexing/android/appActivity

For more information about App Indexing just follow this links

https://developers.google.com/app-indexing/

https://developers.google.com/app-indexing/introduction

And that’s all, I know it’s really confusing and not really easy to understand but i think after you follow all those links and  read those information carefully, you will realized the power of app indexing and how important to have this on your application or games.

And there you go, we are done, I Hope you find this tutorial really helpful

Thank  you for visiting and reading our tutorial, Happy Coding 🙂

For comments or Suggestions or feedback or Questions just email us at gigadrillgames@gmail.com

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.