adjust-icon

Set up deferred deep linking

Deferred deep linking allows users who don’t have your app installed to click an Adjust link, install your app from the App Store, and then be directed to their intended content when they first open the app.

How it works

This is the basic flow of deferred deep linking:

  1. The user clicks on an Adjust deep link.
  2. Adjust’s servers redirect the user to the App Store.
  3. The user installs your app and opens it.
  4. Adjust’s servers perform attribution and send the deep link to the Adjust SDK.
  5. If applicable, your app displays its initial screens, such as onboarding screens and user login.
  6. The Adjust SDK delivers the deferred deep link to your app. Your app then handles this link to direct the user to the appropriate screen. (The exact mechanism for this step depends on your setup, as described below.)

When a user clicks an Adjust branded link (brandname.go.link) and the link is deferred, Adjust’s servers convert it to app scheme format (example://), using the app scheme configured in the iOS platform settings in the Adjust dashboard, before passing it to the SDK.

As a result, you should configure your app to handle Adjust branded links and app scheme deep links in the same way. For example, both of the following links should open the same screen:

  • Adjust branded link: https://brandname.go.link/summer-clothes?promo=beach
  • App scheme deep link: example://summer-clothes?promo=beach

Your app has to handle the deferred deep link by parsing its components (example: path, query parameters) and navigating to the appropriate screen.

Setup

  1. Conform to the AdjustDelegate protocol in your AppDelegate. If you have already configured attribution callbacks, you can skip this step.
  1. Assign your AppDelegate as the delegate in the Adjust configuration before initializing the SDK.
  1. Add the adjustDeeplinkResponse callback method to your app delegate. The Adjust SDK calls this method after receiving a deferred deep link.

Return Value Options

The return value of adjustDeeplinkResponse determines what happens after your callback code executes:

Return false (most common)

Use this approach if you want your app to have complete control over when and how to process the deferred deep link. By returning false, the Adjust SDK will not attempt to open the deferred deep link. For example, this approach is appropriate if your app needs to show and move past initial screens (like onboarding or login) before handling the deferred deep link.

Return true

Use this approach if you want the Adjust SDK to attempt to open the deferred deep link immediately after the callback code runs. For example, this approach is appropriate if your app does not have any initial screens.

When the Adjust SDK receives the deferred deep link, your callback code runs, and then the Adjust SDK calls application(_:open:options:) with the deferred deep link, which iOS then routes to the appropriate handler based on your app setup:

App ImplementationHandler
UIKit using AppDelegateapplication(_:open:options:)
UIKit using SceneDelegatescene(_:openURLContexts:)
SwiftUI.onOpenURL modifier

To handle the deep link from the appropriate handler above, ensure that you have already implemented direct deep linking.

Full code example

This example shows an app that has an onboarding process that has to complete before the app can handle deferred deep links. Here is a summary of how the example code works.

  1. A user who doesn’t have the app installed clicks an Adjust deep link, which redirects them to the app store.
  2. The user installs and opens the app.
  3. The Adjust SDK sends session and attribution requests to Adjust’s servers.
  4. The app begins its onboarding process.
  5. Adjust’s servers respond with attribution data, including the deep link the user clicked on (“deferred deep link”).
  6. The Adjust SDK triggers a deferred deep link callback in the app (shown in AppDelegate below). The callback checks whether onboarding is complete:
    • If onboarding is complete, it handles the deep link immediately.
    • If onboarding isn’t complete, it stores the deep link.
  7. Once onboarding completes, the app checks for and handles any stored deferred deep link (shown in the ViewController and ContentView examples below).
  8. The app navigates the user to the deep link screen.

AppDelegate

Deferred deep linking updates to AppDelegate are in the highlighted code. This example is applicable to both the UIKit and SwiftUI examples.

UIKit

SwiftUI