Deep Links. How to Implement It an M-commerce App

5.0 / 5.0
Article rating

Most people won’t bother searching for a product they’ve seen in an ad – especially if this ad simply directs them to a website’s home page. How can you quickly show your customers what they want to see? How can you accelerate purchases and win your users’ loyalty? The answer is deep links.

What is deep linking

Deep linking is a technology where links direct users to a particular place in a mobile website or application. For example, if you advertise a product you can direct customers right to the product page.

Deep linking is one way to increase conversions while promoting your IT products. It erases barriers and allows users to find what they need quickly. This is especially important in mobile apps.

When you send emails, push notifications, or messages with information about discounts or promotional campaigns, you can’t just make the application load the landing screen. Promotional campaigns provide unique offers in a certain category, and you need to make sure that your customers don’t have to search in your application to find the products you’re promoting. This is when deep links become really useful.

The main problem they solve is friction in the UX. Maybe this won’t be a issue if your mobile store features just three products, but if there are hundreds, a user won’t even try to find an exact item. Deep links, on the other hand, help to improve UX and therefore customer loyalty.

How Deep Links Work

So, how does deep linking work? If you use an Android phone, you’ve probably seen “Open with…” menus.

These menus appear when you’re trying to open an address that’s connected to one of your installed apps. If you already have an application installed, you’ll be directed to a specific page within it. Otherwise, the page will open in a web browser.

These menus pop up only once assuming you choose to always open such links with a given application, but this can be changed in Android device settings.

If you want to offer your users all the benefits of a mobile app such as better performance and push notifications, you can offer them to install your app when they open a deep link. This will happen if you don’t set a custom URL. In this case, the user will be directed to the app store and the page in the application will be opened right after it is installed.

In recent years, it’s become apparent that even this technology is no longer enough to fully meet users’ needs, however. The modern trend is multi-platform linking, which allows you to build universal links. This means that a single URL can point to multiple destinations simultaneously, and the local client can determine what app to use to open this link.

Android uses Android App Links to do this, while iOS uses Universal Links.

However, Android App Links work only for Android 6.0 and above. For older versions of Android beginning with 4.2, you’ll need to use Android URL schemes.

Mobile and Web development services
Are you planning to expand your business online? We will translate your ideas into intelligent and powerful IT solutions.

What are deferred deep links?

Sometimes a user can’t open a deep link because they don’t have an app on their smartphone, and the deep link leads to a page in that app. Deferred deep links are what helps in this situation. If a user doesn’t have an app installed, they can be directed to the application market, App Store or Google Play depending on their platform, where they can download an app and go directly to the place where the link directed them initially.

Another option is to open a web version of an application, so that a user can still view the information without having to download an app. A good idea is to offer the app download, but give a user a chance to view the web version still.

Deep Links vs Android App Links

Before we talk about implementation, let’s make an Android app links vs Deep links comparison.

Deep links don’t give specific directions to an app. If there are several apps that are able to open a URL, a dialog will appear to ask the user what app to use to open the link.

Android App Links (AALs) (AALs) on Android 6.0 and later, on the other hand, don’t need to ask a user anything. It’s possible to assign a link to a specific application. If a user doesn’t want the assigned app to open such URLs, this can be changed in the device settings. In iOS these links are called universal links, and the comparison of deep link vs universal link in iOS is rather similar. In this article we’ll focus on Android app development. If you want to learn more about universal links vs deep links comparison for iOS, you can do it here.

There are certain benefits of AALs:

  • Security: AALs use URLs that are connected with your domain. This means that no other app will be able to open your links. You’ll need to verify domain ownership to use this technology through one of the Android association methods.
  • Perfect UX: if users don’t have an app installed yet, they’ll simply be directed to a page on your website.

Now let’s talk about how to create a deep link for your Android app.

How to Create a Deep Link in Android

Here’s a tutorial on deep link implementation.

You can start from Google’s documentation, but there are some tricks in my tutorial that can save your time. In this tutorial, we’ll be using DeepLinkDispatch, an Android SDK for deep linking.

Step 1

First, you should find the AndroidManifest file and add an intent-filter with action.VIEW, category.DEFAULT, and category.BROWSABLE children:

    	<intent-filter android:autoVerify="true">
        	<action android:name="android.intent.action.VIEW"/>
        	<category android:name="android.intent.category.DEFAULT"/>
        	<category android:name="android.intent.category.BROWSABLE"/>
        	<data android:host="" android:scheme="http"/>

The elements and attributes of an intent filter are the following:

1. <action>
The action tag defines what happens in the app when a link is clicked; it specifies the action view.

2. <category>
The category tag defines the properties of a deep link. The BROWSABLE category allows it to be opened in a web browser. The DEFAULT category allows a it to be opened without specifying the app name.

3. <data>
The data tag specifies a URI as a deep link; it must include the android:scheme attribute.

Here’s manifest sample code in XML format, which calculates GPA.

Step 2

Now you need to add code in your app to show a particular resource when a deep link is clicked. Call the getData() and getAction() methods to retrieve the data and action associated with the incoming intent.

You can call these methods at any time during the life cycle of your activity, but it’s best to add these operations in OnCreate() or OnStart().

The following code retrieves data from an intent:

public void onCreate (Bundle savedInstanceState ) {
   super.onCreate ( savedInstanceState );
   setContentView ( R.layout.main );
   //get intent
   Intent intent = getIntent ();
   //get action
   String action = intent.getAction ();
   //get data
   Uri data = intent.getData ();

Add your code below getData. Your deep link should take the user directly to the activity without prompts or logins.

Also, here’s a simple yet noteworthy library from Airbnb for handling deeplinks.

Step 3

You’ll still have to add thousands of lines of XML code to your manifest file, and this library won’t save you from Google’s ugly pattern realization. But it will make it much easier to handle links in your app.

So instead of adding an intent-filter child to your Activity tag, you should define a new NoDisplay activity named .DeepLinkActivity. This activity is provided by the following library:

    	<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="" android:scheme="http"/>

And here’s how it handles deep links:

public class MainActivity extends Activity {
  @Override protected void onCreate(Bundle savedInstanceState) {
    Intent intent = getIntent();
	if (intent.getBooleanExtra(DeepLink.IS_DEEP_LINK, false)) {
      Bundle parameters = intent.getExtras();
      String idString = parameters.getString("id");
      // Do something with the ID...

If you’re interested in implementing Android App Links, you’ll need to verify ownership of your domain. You can check out how to do that here.

Our experience

The most important experience we had with deep links is linked to our big ecommerce project we’ve been developing for almost four years already. This is a mobile app of a huge electronics retailer that thousands of products. Whenever the products are displayed in an advertisement banner inside the application, or is mentioned in a push notification, it needs a deep link.

Our team of developers worked with marketers to determine the best way to drive sales with the help of push notifications and deep links. In this case study you can read our results after implementing these mobile-specific features that allowed us to increase conversion rates and sales.

Final Thoughts

Our developers have found DeepLinkDispatch to be really useful. It’s an annotation-based SDK that helps to make deep linking easier to handle on Android.

DeepLinkDispatch allows you to use annotations to for handling and makes information processing easy and fast. With this SDK, you won’t need a million lines of code to process routes around your application.

If you have any questions about implementing deep or Android App links, don’t hesitate to contact Mobindustry. We’ll gladly share our experience implementing deep linking in Android and iOS apps. 

Rate the article!

🌕 Cool!
🌖 Good
🌗 So-so
🌘 Meh
🌑 …