Receive Smart Links on Android

GetSocial Smart Links combine two types of mobile app linking:

  • Deep Linking provides a way to direct the user to a specific location within a mobile app rather than simply launching the app.
  • Deferred Deep Linking that allows users to deep link to content even if the app is not already installed.

Each Smart Link has associated referral data, which you can retrieve on the mobile side. This data consists of parameters you specify during link creation and additional metadata added by GetSocial.


Dashboard Configuration

To set up deep linking follow the next steps:

  1. Login to the GetSocial Dashboard.
  2. Go to the App setting section.
  3. Ensure that Package name and Signing-certificate fingerprint fields matches the app you are integrating:

    GetSocial Dashboard - Android Package Name Configuration

Setup Deep Linking

GetSocial Gradle Plugin configures everything automatically. If you’re not using plugin read how to configure deep linking manually.

Retrieve Referral Data

You can retrieve referral data attached to the Smart Link when:

  • The app is launched for a first time after being installed by clicking on the GetSocial Smart Link.
  • The app was opened by clicking on the GetSocial Smart Link.

The code below show how to do it:

GetSocial.getReferralData(new FetchReferralDataCallback() {
    public void onSuccess(@Nullable ReferralData referralData) {
        if(referralData != null)
            Toast.makeText(MainActivity.this, "App started with Referral Data: " + referralData, Toast.LENGTH_LONG).show();
            Toast.makeText(MainActivity.this, "No Referral Data found", Toast.LENGTH_LONG).show();

    public void onFailure(GetSocialException error) {
        Toast.makeText(MainActivity.this, "Failed to retrieve Referral Data, error: " + error, Toast.LENGTH_LONG).show();

Returned referral data contains:

  • Link params attached to the link during the creation.
  • Metadata added by GetSocial, e.g. channel, referrer user, if we guarantee attribution, etc. For a full list of available properties check the Referral Data Reference and API Reference.

Single Task/Single Top Launch Mode

To retrieve referral data when your Activity is launched in Single task or Single top mode, you have to add following code to your Activity:

protected void onNewIntent(Intent intent) {

Validate Setup

  1. Create a Smart Link from the Dashboard or send a Smart Invite.
  2. Click on the link on your phone, your app should be opened.

    Make sure to run this test on the device with Android 6+ and Android below 6, as we use different deep linking mechanics on pre-Android 6 devices.

    Smart Invite via Twitter with Custom Subdomain

  3. Additionally on Android 6+ devices, go to App info -> Open by default, supported deep linking domains should be listed in Supported links section:

    Supported links section

Whitelist Test Devices

To get the install attribution on every install you have to whitelist your testing devices on the GetSocial Dashboard.
For more information check Whitelist Test Devices.

Next Steps

Give us your feedback! Was this article helpful?

😀 🙁