[L3882] Tracking Cross App Promotions - Adobe-Marketing-Cloud/aml-summit-lab GitHub Wiki

Tracking Cross-App Promotions

Objective

Sometimes you want to encourage your users to download one of your other apps. In a traditional workflow, your acquisition link opens in Safari, then redirects to your app in the app store. In this lab you will learn how to attribute acquisition from one app to another while bypassing Safari. You can also achieve 100% attribution using app-to-app acquisition. In this lab, we will use specific terminology to differentiate between our apps:

  • Source App - The app that your user is already in. This is where the app-to-app acquisition workflow begins.
  • Destination App - The app you are trying to get your user of the source app to install. This is where the app-to-app acquisition workflow ends.

Pre-requisites

In order to implement App-to-App acquisition, you need to have two apps. You also need to know the acquisition appid generated by Adobe Mobile Services (this can be found in the ADBMobileConfig.json file). In this exercise, we will be using our Bea[rd]cons app as the destination app for demonstrative purposes.

Implementation steps

Identify the App ID for your destination app

  1. Navigate to Manage App Settings in Adobe Mobile Services for your destination app.
    • Note - your destination app must be enabled for acquisition. If it is not, enable acquisition and save changes in your app settings.
  1. Scroll down to the SDK Acquisition Options section, and click on the More Details link.
  1. We will use App ID of the destination app in the SDK when we start the acquisition process. The App ID for your app is the part of the Manual URL Path that comes after https://c00.adobe.com/v3/. For example:

     // Manual URL Path
     https://c00.adobe.com/v3/799752ef587558a90ba136ab1766b226f0fd535a35124c3def885dc560ab931e
     
     // App ID
     799752ef587558a90ba136ab1766b226f0fd535a35124c3def885dc560ab931e  
    

In your source app, begin the acquisition process and navigate your user to your target app

  1. In Xcode, navigate to TipDriverViewController.m.
  1. The app already has a button set up to handle our link. We just need to make sure it shows when we want it to, and implement its functionality. First, add code to the updateTextForLabels method to show our button only when users go to the Casino.

     _btnBeardcons.hidden = ![_user.trip.destination.name isEqualToString:@"Casino"];
    
  1. At the bottom of the page, implement the linkToBeardcons: method. This code will kick off the acquisition process for this user and link them directly to your app in the App Store.
    • Note - this is where we need to use the App ID for the destination app.

        [ADBMobile acquisitionCampaignStartForApp:@"799752ef587558a90ba136ab1766b226f0fd535a35124c3def885dc560ab931e" data:nil];
      
        [[UIApplication sharedApplication]
            openURL:[NSURL URLWithString:@"https://itunes.apple.com/us/app/bea-rd-cons/id835196493?mt=8&uo=4"]
            options:@{} completionHandler:nil];  
      
  1. Hit the run button.
  1. Click through the app and travel to the Casino. Notice that your button is now visible, and clicking on it will redirect to our Bea[rd]cons app in the App Store.

If the user installs and launches your destination app, the SDK will automatically attribute the install to the link you created in your source app.

Get 100% App-to-App acquisition attribution by leveraging IDFA

The IDFA (aka - Advertising Identifier) generated by Apple is unique per device + developer account combination. This means that the IDFA value from your source app will match the IDFA in your destination app (assuming you are using the same developer account for both applications). Using this common value, you can achieve 100% acquisition attribution in the Adobe SDK.

  1. In Xcode, navigate to AppDelegate.m.
  1. In the application:didFinishLaunchingWithOptions: method, add in the following code to give the IDFA to the Adobe SDK.

     // get IDFA from Apple and pass it to Adobe SDK
     NSString *idfaString = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
     [ADBMobile setAdvertisingIdentifier:idfaString];
    
  1. In your destination app, repeat steps 1 and 2. It is important that you make this call before making your call to collectLifecycleData (or any other tracking call).

By following these steps, the IDFA for your user will be attached to the acquisition start call made by your source app. Then, in the destination app, it will be used automatically by the SDK when we look for attribution from our fingerprinter server. Because the IDFA is unique for this user, we will always achieve 100% attribution.

Related documentation

Check out the documentation for more information about the SDK APIs used in this exercise.