adjust-icon

Integration guide

This is a step-by-step guide to help you integrate and configure the Adjust Extension in your Adobe Experience app for iOS. With this extension, you can seamlessly integrate Adjust with the Adobe Experience SDK to capture and send attribution data and in-app event information.

This extension enables you to send installs, sessions, custom in-app events, and other types of data to Adjust. Follow this guide to set up and configure the Adjust Extension and verify that you can send install information to Adjust.

Set up your project

Follow these steps to set up your project to support the Adjust Extension for Adobe Experience SDK.

Install the Adjust Extension

To use the Adjust Extension for Adobe Experience SDK, you need to add it to your project as a dependency.

If you're using Swift Package Manager, enter the following URL:

https://github.com/adjust/ios_adobe_extension.git

If you're using CocoaPods, add the following line to your Podfile:

Podfile
pod 'AdjustAdobeExtension'

Add iOS frameworks

The Adjust Extension requires additional iOS frameworks to access information about a device. Add the following frameworks and mark them as optional to enable these features.

AdSupport.framework

Used to access the ID for Advertisers (IDFA) and Limited Ad Tracking (LAT) information. LAT is available only on devices running iOS 14 or earlier.

AppTrackingTransparency.framework

Used to enable the Adjust Extension to wrap the user AppTrackingTransparency (ATT) consent dialog and access a user's ATT consent data. ATT is avaliable only on devices running iOS 14 or later.

AdServices.framework

Used to enable the Adjust Extension to automatically handle attribution for Apple Search Ads (ASA) campaigns on devices running iOS 14.3 or later. Required when using the Apple Ads Attribution API.

StoreKit.framework

Used to enable the Adjust Extension to communicate with theSKAdNetworkframework on devices running iOS 14 or later.

Integration guide

Once you've completed the project setup steps, you can integrate the Adjust SDK. The following guide shows you how to:

  1. Add the Adjust Extension to your Adobe Experience app.
  2. Set your logging level to verbose to retrieve as much detail as possible from the extension.
  3. Test the Extension in sandbox mode to ensure it sends data to Adjust.
  4. Enable your app to open deep links.
  5. Register with the Adobe Experience SDK.

To do this, you need to create the following files:

Import classes

First, you need to import some classes into your application files. Import the following classes into your App Delegate:

AEPCore

Contains the implementation of the Event Hub.

AEPServices

Provides implementations for platform support such as networking, disk access, and database management.

AdjustAdobeExtension

The Adjust Extension for Adobe Experience SDK.

Next, import the following classes into your View Controller:

AEPCore

Contains the implementation of the Event Hub.

AdjustAdobeExtension

The Adjust Extension for Adobe Experience SDK.

Create an App Delegate

To register the Adjust iOS Extension for Adobe Experience SDK, you need to create an App Delegate. If you've not yet created an App Delegate, follow these steps:

  1. Create a new AppDelegate implementation.

  2. Within your AppDelegate implementation, create a new function called application that returns a boolean. This function takes the following arguments:

    application: UIApplication

    The singleton app object.

    launchOptions: [UIApplication.LaunchOptionsKey : Any]

    A dictionary indicating the reason the app was launched.

Configure the Adjust Extension

Once you've created the App Delegate, follow these steps to configure the Adjust iOS Extension for Adobe Experience SDK:

  1. Inside your application function, set your logging level by calling the setLogLevel method of the AEPMobileCore class with the following argument:

    logLevel

    The level of logging you want to enable.

    • Trace: enable all logging.
    • Debug: disable verbose logging.
    • Warning: log only errors and warnings.
    • Error: log only errors.
  2. Create a new UIApplicationState variable called appState. You'll use this to communicate the app state with the Adobe Experience SDK.

  3. Create a new AdjustAdobeExtensionConfig instance named config with the following argument:

    environment: NSString

    The environment in which your device is running.

    • Pass ADJEnvironmentSandbox when testing.
    • Pass ADJEnvironmentProduction when running the app in production.
  4. Call the setConfiguration method of the AdjustAdobeExtension class with your configuration instance as an argument to register the configuration.

Register the Adjust Extension

Once you've configured the Adjust Extension, you need to register it with the Adobe Experience SDK. To do this:

  1. Inside your application function, call the registerExtensions method of the AEPMobileCore class with the following arguments:

    extensions: NSArray<Class*>* _Nonnull

    A list of extensions.

    completion: (^ _Nullable)(void))

    A completion handler.

    For the purposes of this guide, pass the AdjustAdobeExtension class for extensions. You'll set your completion handler in the next step.

  2. Within the completion handler, call the configureWithAppId method of the AEPMobileCore class with your Adobe App ID.

  3. Inside your completion handler, add an if block to call the lifecycleStart method of the AEPMobileCore if the app isn't in the background.

  4. Finally, return a true value at the top level of your application function.

To configure the Adjust iOS Extension for Adobe Experience SDK to open deep links, follow these steps:

  1. Within your AppDelegate implementation, create a new boolean function called application to handle opening deep links. Thie function takes the following arguments:

    app: UIApplication

    The singleton app object.

    url: NSURL

    The URL resource to open in the app.

    options: [UIApplicationOpenURLOptionsKey : id]

    A dictionary of options for handling the URL, containing keys that specify options related to the URL.

  2. Inside this function, call the processDeeplink method of the Adjust class to open the deep link and return a true value.

  3. Next, create another boolean function called application to handle resuming user activity. This function takes the following arguments:

    application: UIApplication

    The singleton app object.

    userActivity: NSUserActivity

    The user activity object that represents the activity to continue.

    restorationHandler: void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable)

    A handler block to use for restoring the app’s state if needed.

  4. Inside this function, add a check to see if the app was opened by a link and call processDeeplink if it is.

    If you use short branded links, you can alternatively use the Adjust.processAndResolveDeeplink method to resolve your shortened link and return it to a callback function.

Set up your View Controller

Next, you need to set up your View Controller. You'll use this file to set up your Adjust features later. For the purposes of this guide, you're only going to set up the viewDidLoad function to handle application startup.

  1. Inside your View Controller file, createa a new ViewController class implementation.

  2. Inside your ViewController class, create a void function that calls super.viewDidLoad to initialize your view.

Once you've completed these steps, build and run your app. After you launch your app, you should see the message Install tracked in your Xcode logs.