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

To use deep links with the Adjust SDK, you first need to enable the opening and reading of deep link information in your app.

Deferred deep linking

Disable deferred deep linking

Method signature
disableDeferredDeeplinkOpening(): void

The SDK opens deferred deep links by default. You can configure this by calling the disableDeferredDeeplinkOpening method.

const adjustConfig = new AdjustConfig(
"{YourAppToken}",
AdjustConfig.EnvironmentSandbox,
);
adjustConfig.disableDeferredDeeplinkOpening();
Adjust.initSdk(adjustConfig);
Method signature
setDeferredDeeplinkCallback(deferredDeeplinkCallback: (deeplink: string) => void): void

You can configure the Adjust SDK to call a delegate function when it receives a deferred deep link. This delegate function receives the deep link as a string argument.

const adjustConfig = new AdjustConfig(
"{YourAppToken}",
AdjustConfig.EnvironmentSandbox,
);
adjustConfig.setDeferredDeeplinkCallback(function (deeplink) {
console.log("Deferred deep link URL content: " + deeplink);
});
Adjust.initSdk(adjustConfig);

Example

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

const adjustConfig = new AdjustConfig(
"{YourAppToken}",
AdjustConfig.EnvironmentSandbox,
);
adjustConfig.setDeferredDeeplinkCallback(function(deeplink) {
console.log("Deferred deep link URL: " + deeplink);
)};
Adjust.initSdk(adjustConfig);
Method signature
processDeeplink(adjustDeeplink: AdjustDeeplink): void

Adjust enables you to run re-engagement campaigns using deep links. For more information, check out how to set up Deep links in Campaign Lab.

To reattribute your user, you need to call the processDeeplink method when the app receives deep link content. 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.

function handleOpenURL(url) {
setTimeout(function () {
// Check content of the url object and get information about the URL.
Adjust.appWillOpenUrl(new AdjustDeeplink(url));
}, 300);
}

You can call the Adjust.processDeeplink function inside your didLaunchAppFromLink method to open universal links.

var app = {
initialize: function () {
this.bindEvents();
},
bindEvents: function () {
document.addEventListener("deviceready", this.onDeviceReady, false);
},
onDeviceReady: function () {
if (device.platform == "iOS") {
universalLinks.subscribe(
"adjustDeepLinking",
app.didLaunchAppFromLink,
);
}
},
didLaunchAppFromLink: function (eventData) {
// Check content of the url object and get information about the URL.
Adjust.appWillOpenUrl(new AdjustDeeplink(eventData.url));
},
};

Enable LinkMe

Method signature
enableLinkMe(): void

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, call the enableLinkMe method on your config object:

const adjustConfig = new AdjustConfig(
"{YourAppToken}",
AdjustConfig.EnvironmentSandbox,
);
adjustConfig.enableLinkMe();
Adjust.initSdk(adjustConfig);