Optimize and personalize with Adobe Target

Learn how to optimize and personalize the experiences in your mobile apps with Platform Mobile SDK and Adobe Target.

Target provides everything that you must tailor and personalize your customers’ experiences. Target helps you maximize revenue on your web and mobile sites, apps, social media, and other digital channels. Target can perform A/B tests, multivariate tests, recommend products and content, target content, auto-personalize content with AI, and much more. The focus in this lesson is on the A/B test functionality of Target. See the A/B Test overview for more information.

Architecture

Before you can perform A/B tests with Target, you must ensure that the proper configurations and integrations are in place.

NOTE
This lesson is optional and only applies to Adobe Target users looking to perform A/B tests.

Prerequisites

  • Successfully built and run app with SDKs installed and configured.
  • Access to Adobe Target with permissions, properly configured roles, workspaces, and properties as described here.

Learning objectives

In this lesson, you will:

  • Update your datastream for Target integration.
  • Update your tag property with the Journey Optimizer - Decisioning extension.
  • Update your schema to capture propositon events.
  • Validate setup in Assurance.
  • Create a simple A/B test in Target.
  • Update your app to register the Optimizer extension.
  • Implement the A/B test in your app.
  • Validate implementation in Assurance.

Setup

TIP
If you have set up your app already as part of the Journey Optimizer offers lesson, you might already have performed some of the steps in this setup section.

Update datastream configuration

Adobe Target

To ensure data send from your mobile app to Experience Platform Edge Network is forwarded to Adobe Target, you must update you datastream configuration.

  1. In the Data Collection UI, select Datastreams, and select your datastream, for example Luma Mobile App.

  2. Select Add Service and select Adobe Target from the Service list.

  3. If you are a Target Premium customer and would like to use property tokens, enter the Target Property Token value that you want to use for this integration. Target Standard users can skip this step.

    You can find your properties in the Target UI, in Administration > Properties. Select Code to reveal the property token for the property you want to use. The property token has a format like "at_property": "xxxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxxxxx"; you must only enter the value xxxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxxxxx.

    Optionally, you can specify a Target Environment ID. Target uses environments to organize your sites and pre-production environments for easy management and separate reporting. The preset environments include Production, Staging, and Development. See Environments and Target Environment ID for more information.

    Optionally, you can specify a Target third-party ID namespace to support profile syncing on an identity namespace (for example CRM ID). See Target Third Party ID namespace for more information.

  4. Select Save.

    Add Target to datastream

Adobe Journey Optimizer

To ensure data send from your mobile app to the Edge Network is forwarded to Journey Optimizer - Decision Management, update your datastream configuration.

  1. In the Data Collection UI, select Datastreams, and select your datastream, for example Luma Mobile App.

  2. Select More for Experience Platform and select Edit Edit from the context menu.

  3. In the Datastreams > Folder > Adobe Experience Platform screen, ensure that Offer Decisioning, Edge Segmentation, and Personalization Destinations are selected. If you also follow the Journey Optimizer lessons, you select Adobe Journey Optimizer. See Adobe Experience Platform settings for more information.

  4. To save your datastream configuration, select Save .

    AEP datastream configuration

Install Adobe Journey Optimizer - Decisioning tags extension

  1. Navigate to Tags, find your mobile tag property, and open the property.

  2. Select Extensions.

  3. Select Catalog.

  4. Search for the Adobe Journey Optimizer - Decisioning extension.

  5. Install the extension. The extension does not require additional configuration.

    Add Decisioning extension

Update your schema

  1. Navigate to Data Collection interface and select Schemas from the left rail.
  2. Select Browse from the top bar.
  3. Select your schema to open it.
  4. In the schema editor, select Add Add next to Field groups.
  5. In the Add field groups dialog, search for proposition, select Experience Event - Proposition Interactions and select Add field groups.
    Proposition
  6. To save the changes to your schema, select Save.

Validate setup in Assurance

To validate your setup in Assurance:

  1. Go to the Assurance UI.
  2. Select Configure in left rail and select Add next to Validate Setup underneath ADOBE JOURNEY OPTIMIZER DECISIONING.
  3. Select Save.
  4. Select Validate Setup in the left rail. Both datastream setup is validated and the SDK setup in your application.
    AJO Decisioning validation

Create an A/B Test

There are many types of activities you can create in Adobe Target and implement in a mobile app, as mentioned in the introduction. For this lesson, you will implement an A/B test.

  1. In the Target UI, select Activities from the top bar.

  2. Select Create Activity and A/B Test from the context menu.

  3. In the Create A/B Test Activity dialog, select Mobile as the Type, select a workspace from the Choose Workspace list, and select your property from the Choose property list if you are a Target Premium customer and specified a property token in the datastream.

  4. Select Create.
    Create Target activity

  5. In the Untitled Activity screen, at the Experiences step:

    1. Enter luma-mobileapp-abtest in Select Location underneath LOCATION 1. This location name (often referred to as an mbox) is used later in the app implementation.

    2. Select Chrevron down next to Default Content and select Create JSON Offer from the context menu.

    3. Copy the following JSON into Enter a valid JSON object.

      code language-json
      {
          "title": "Luma Anaolog Watch",
          "text": "Designed to stand up to your active lifestyle, this women's Luma Analog Watch features a tasteful brushed chrome finish and a stainless steel, water-resistant construction for lasting durability.",
          "image": "https://luma.enablementadobe.com/content/dam/luma/en/products/gear/watches/Luma_Analog_Watch.jpg"
      }
      
    4. Select + Add Experience.

      Experience A

    5. Repeat step b and c for experience Experience B, but instead use the following JSON:

      code language-json
      {
          "title": "Aim Analog Watch",
          "text": "The flexible, rubberized strap is contoured to conform to the shape of your wrist for a comfortable all-day fit. The face features three illuminated hands, a digital read-out of the current time, and stopwatch functions.",
          "image": "https://luma.enablementadobe.com/content/dam/luma/en/products/gear/watches/Aim_Watch.jpg"
      }
      
    6. Select Next.

      Experience B

  6. In the Targeting step, review the setup of your A/B test. By default, both offers are allocated equally across all visitors. Select Next to continue.

    Targeting

  7. In the Goals & Settings step:

    1. Rename your Untitled Activity, for example to Luma Mobile SDK Tutorial - A/B Test Example.

    2. Enter an Objective for your A/B test, for example A/B Test for Luma mobile app tutorial.

    3. Select Conversion, Viewed an mbox in the Goal Metric > MY PRIMARY GOAL tile and enter your location (mbox) name, for example luma-mobileapp-abtest.

    4. Select Save & Close.

      Goals Settings

  8. Back in the All Activities screen:

    1. Select More at your activity.
    2. Select Play Activate to activate your A/B test.

    Activate

Implement Target in your app

As discussed in previous lessons, installing a mobile tag extension only provides the configuration. Next you must install and register the Optimize SDK. If these steps aren’t clear, review the Install SDKs section.

NOTE
If you completed the Install SDKs section, then the SDK is already installed and you can skip this step.
  1. In Xcode, ensure that AEP Optimize is added to the list of packages in Package Dependencies. See Swift Package Manager.

  2. Navigate to Luma > Luma > AppDelegate in the Xcode Project navigator.

  3. Ensure AEPOptimize is part of your list of imports.

    import AEPOptimize

  4. Ensure Optimize.self is part of the array of extensions that you are registering.

    code language-swift
    let extensions = [
        AEPIdentity.Identity.self,
        Lifecycle.self,
        Signal.self,
        Edge.self,
        AEPEdgeIdentity.Identity.self,
        Consent.self,
        UserProfile.self,
        Places.self,
        Messaging.self,
        Optimize.self,
        Assurance.self
    ]
    
  5. Navigate to Luma > Luma > Utils > MobileSDK in the Xcode Project navigator. Find the func updatePropositionAT(ecid: String, location: String) async function. Add the following code:

    code language-swift
    // set up the XDM dictionary, define decision scope and call update proposition API
    Task {
        let ecid = ["ECID" : ["id" : ecid, "primary" : true] as [String : Any]]
        let identityMap = ["identityMap" : ecid]
        let xdmData = ["xdm" : identityMap]
        let decisionScope = DecisionScope(name: location)
        Optimize.clearCachedPropositions()
        Optimize.updatePropositions(for: [decisionScope], withXdm: xdmData)
    }
    

    This function:

    • sets up an XDM dictionary xdmData, containing the ECID to identify the profile for which you have to present the A/B test, and
    • defines a decisionScope, an array of locations on where to present the A/B test.

    Then the function calls two API’s: Optimize.clearCachedPropositions and Optimize.updatePropositions. These functions clear any cached propositions and update the propositions for this profile. A proposition in this context is the experience (offer) that is selected from the Target activity (your A/B test) and which you defined in Create an A/B test.

  6. Navigate to Luma > Luma > Views > Personalization > TargetOffersView in the Xcode Project navigator. Find the func onPropositionsUpdateAT(location: String) async { function and inspect the code of this function. The most important part of this function is the Optimize.onPropositionsUpdate API call, which:

    • retrieves the propositions for the current profile based on the decision scope (which is the location you have defined in the A/B Test),
    • retrieves the offer from the proposition,
    • unwraps the content of the offer so it can be displayed properly in the app, and
    • triggers the displayed() action on the offer which sends an event back to Platform Edge Network informing the offer is displayed.
  7. Still in TargetOffersView, add the following code to the .onFirstAppear modifier. This code ensures the callback for updating the offers is registered only once.

    code language-swift
    // Invoke callback for offer updates
    Task {
        await self.onPropositionsUpdateAT(location: location)
    }
    
  8. Still in TargetOffersView, add the following code to the .task modifier. This code updates the offers when the view is refreshed.

    code language-swift
    // Clear and update offers
    await self.updatePropositionsAT(ecid: currentEcid, location: location)
    

You can send additional Target parameters (like mbox, profile, product, or order parameters) in a personalization query request to the Experience Edge network, by adding them in a data dictionary when calling the Optimize.updatePropositions API. See for more information Target Parameters.

Validate using the app

  1. Rebuild and run the app in the simulator or on a physical device from Xcode, using Play .

  2. Go to the Personalisation tab.

  3. Scroll down to the bottom, and you see one of the two offers that you have defined in your A/B test displayed in the TARGET tile.

    {width="300"}

Validate implementation in Assurance

To validate the A/B test in Assurance:

  1. Review the setup instructions section to connect your simulator or device to Assurance.

  2. Select Configure in left rail and select Add next to Review & Simulate underneath ADOBE JOURNEY OPTIMIZER DECISIONING.

  3. Select Save.

  4. Select Review & Simulate in the left rail. Both datastream setup is validated and the SDK setup in your application.

  5. Select Requests at the top bar. You see your Target requests.
    AJO Decisioning validation

  6. You can explore Simulate and Event List tabs for further functionality checking your setup for Target offers.

Next steps

You should now have all the tools to start adding more A/B tests or other Target activities (such as Experience Targeting, Multivariate Test), where relevant and applicable, to your app. There is more in-depth information available in the GitHub repo for the Optimize extension where you can also find a link to a dedicated tutorial on how to track Adobe Target offers.

SUCCESS
You have enabled the app for A/B tests and displayed the results of an A/B test with Adobe Target and the Adobe Journey Optimizer - Decisioning extension for the Adobe Experience Platform Mobile SDK.
Thank you for investing your time in learning about Adobe Experience Platform Mobile SDK. If you have questions, want to share general feedback, or have suggestions on future content, share them on this Experience League Community discussion post.

Next: Conclusion and next steps

recommendation-more-help
9fed61f5-c338-47ad-8005-0b89a5f4af8b