adjust-icon

Deep linking

You can create deep links to take users to specific pages in your app. The Adjust SDK uses different logic depending on if the user already has your app installed on their device:

  • Direct deep linking: occurs if the user already has your app installed. The link takes the user to the page specified in the link
  • Deferred deep linking: occurs if the user doesn’t have your app installed. The link takes the user to a storefront to install your app first. After the user installs the app, it opens to the page specified in the link.

The SDK can read deep link data after a user opens your app from a link.

Set up deep linking

If a user has your app installed, it opens when they interact with a link containing deep link information. The Adjust SDK contains tools to parse deep link information for use throughout your app.

You need to set up deep linking on an app level. Follow the instructions linked below to set up deep linking on your target platform:

To reattribute your user, you need to instantiate an ADJDeeplink/AdjustDeeplink object with your deep link URL and pass it to the Adjust.processDeeplink method. The Adjust SDK then looks for new attribution data within the deep link. If the SDK finds new information, it forwards the information to Adjust’s servers for reattribution.

iOS

Method signature
+ (void)processDeeplink:(ADJDeeplink *)deeplink

To enable Adjust reattribution via deep linking, make sure to call Adjust.processDeeplink method once you obtain the deep link in one of your app delegate callbacks.

Android

Method signature
public static void processDeeplink(AdjustDeeplink deeplink)

To enable Adjust reattribution via deep linking, make sure to call Adjust.processDeeplink method once you obtain the deep link in your activity.

Deferred deep linking

Property declaration
bool? isDeferredDeeplinkOpeningEnabled;

The SDK opens deferred deep links by default. No additional setup is required. You can disable this by setting the isDeferredDeeplinkOpeningEnabled property on your config instance to false.

AdjustConfig adjustConfig = new AdjustConfig('{YourAppToken}', AdjustEnvironment.sandbox);
//...
adjustConfig.isDeferredDeeplinkOpeningEnabled = false;
//...
Adjust.initSdk(adjustConfig);
Property declaration
typedef void DeferredDeeplinkCallback(String? deeplink);
DeferredDeeplinkCallback? deferredDeeplinkCallback;

You can configure the Adjust SDK to call a function when it receives a deferred deep link by adding a function to the deferredDeeplinkCallback property on your config instance. This function receives the deep link as a String argument.

AdjustConfig adjustConfig = new AdjustConfig('{YourAppToken}', AdjustEnvironment.sandbox);
adjustConfig.deferredDeeplinkCallback = (String? deeplink) {
print('[Adjust]: Received deferred deeplink: ' + deeplink);
};
Adjust.initSdk(adjustConfig);

Example

This example shows how to log a deep link address when the user opens a deferred deep link.

import 'package:adjust_sdk/adjust.dart';
import 'package:adjust_sdk/adjust_config.dart';
initPlatformState() async {
AdjustConfig config =
new AdjustConfig('2fm9gkqubvpc', AdjustEnvironment.sandbox);
config.logLevel = AdjustLogLevel.verbose;
config.deferredDeeplinkCallback = (String? uri) {
print('[Adjust]: Received deferred deeplink: ' + uri!);
};
Adjust.initSdk(config);
}

Enable LinkMe

Property declaration
bool? isLinkMeEnabled;

The Adjust SDK lets you copy deep link information from the device pasteboard. When combined with Adjust’s LinkMe solution, this feature enables deferred deep linking on devices running iOS 15 and above.

When a user clicks on a LinkMe URL they have the option to copy the link information to their system pasteboard. You can use the Adjust SDK to read the system pasteboard for deep link information. If deep link information is present, the SDK forwards the user to the correct page in your app.

To enable pasteboard checking in your app, set the isLinkMeEnabled property to true on your config object:

AdjustConfig adjustConfig = new AdjustConfig('{YourAppToken}', AdjustEnvironment.sandbox);
//...
adjustConfig.isLinkMeEnabled = true;
//...
Adjust.initSdk(adjustConfig);