Apphud – integrate, analyze and improve in-app purchases and subscriptions in your iOS/Android apps

Marketing

Measuring Apple Search Ads campaigns without IDFA

Hi there! In last couple of months we had released many updates: A/B experiments, Firebase Integration and more. Let’s take a closer look at one of the features that is fully supported by Apphud – new Apple Search ads attribution, which works on iOS 14.3+ devices via AdServices framework and doesn’t require user ATT consent. Thus you will be able to run paid campaigns and measure Apple Search Ads without IDFA in real time. No SKAdNetwork required.

Apple Ads Attribution API

The new AdServices framework lets you retrieve device attribution token, that can be used to measure and attribute downloads in your Apple Search ads campaigns. The token that the framework returns is a string and has a 24-hour TTL. Apple Ads Attribution API is a REST API that retrieves attribution data from Apple Search Ads campaigns.

Interaction between Apple Ads Attribution API and AdServices framework
Interaction between Apple Ads Attribution API and AdServices framework

Depending on user ATT consent, there will be detailed or standard payload.

Here is the example of detailed attribution response:

{
 "attribution": true,
 "orgId": 40669820,
 "campaignId": 542370539,
 "conversionType": "Download",
 "clickDate": "2020-04-08T17:17Z",
 "adGroupId": 542317095,
 "countryOrRegion": "US",
 "keywordId": 87675432,
 "creativeSetId": 542317136
}

And this is the example of standard response:

{
 "attribution": true,
 "orgId": 40669820,
 "campaignId": 542370539,
 "conversionType": "Download",
 "adGroupId": 542317095,
 "countryOrRegion": "US",
 "keywordId": 87675432,
 "creativeSetId": 542317136
}

As you can see, the only difference is clickDate. But, since installation date can be easily determined by App Store receipt or just first launch date, we can admit that attribution works for all downloads regardless of ATT consent. Pretty cool, isn’t it?

Retrieving campaign names

By default, attribution payload contains just IDs: campaignId, adGroupId, keywordId. In order to retrieve human readable names, you will need to make additional API calls using OAuth authorisation.

The flow is as follows:

  • Create and invite new user to Apple Search Ads dashboard with API user role.
  • Generate public-private key pair.
  • Upload public key in Apple Search ads setting under the user with API role.
  • Copy Client Secret, Team ID, Key ID.
  • Get Access Token with given fields.

After all of that you can make API calls to get campaign names, keyword names, etc.

Measuring Apple Search Ads campaigns in Apphud

Integrating new Apple Search Ads API in Apphud is super easy, as we do most of the work for you:

  • Apphud generates public key for you, just copy the value and insert in Apple Search Ads settings under the user with API user role.
  • Automatically retrieves access token and campaign names.
  • Displays human readable attribution data in user page.
  • Shows charts segmented by campaign, ad set group and even by keyword.
  • Works in real time.
  • No need to set up SKAdNetwork and call updateConversionValue – Apple Search Ads works without it.
User page in Apphud that came from Apple Search Ads campaign
User page in Apphud that came from Apple Search Ads campaign
Analyze your Apple Search Ads campaigns in Apphud
Analyze your Apple Search Ads campaigns in Apphud in real time

All you need to do in the app – is retrieve attribution token and pass it to Apphud SDK.

import AdServices
import iAd // optional

private func trackAppleSearchAds() {
       if #available(iOS 14.3, *) {
           DispatchQueue.global(qos: .default).async {
               if let token = try? AAAttribution.attributionToken() {
                   DispatchQueue.main.async {
                       Apphud.addAttribution(data: nil, from: .appleAdsAttribution, identifer: token, callback: nil)
                   }
               }
           }
       } else {
       // optional: send old Search Ads attribution data from older iOS versions
           ADClient.shared().requestAttributionDetails { data, _ in
               data.map { Apphud.addAttribution(data: $0, from: .appleSearchAds, callback: nil) }
           }
       }
   }

More details about integration can be found in our documentation.

Have a nice day!

Leave a Reply

Your email address will not be published. Required fields are marked *