Apple Search Ads
Promote your app on the App Store via Apple Search Ads and analyse revenue and other metrics segmented by keywords or campaigns in Apphud.
There are two ways to get Apple Search Ads attribution data: via iAd framework or via new AdServices framework. The last one is available on iOS 14.3+ devices.
Framework
Supported iOS versions
Requires user ATT consent
Requires generating private key
Available on free plan
iAd
Deprecated since iOS 14.5
Yes
No
Yes
AdServices
iOS 14.3+
No
Yes
No
As you can see in the table above, attribution using AdServices framework works regardless of user's ATT consent. However it's a little bit complicated to set up auth credentials.

Apple Search Ads Attribution via AdServices framework (iOS 14.3+)

Available on paid plans only
Step 1
Step 2
Step 3
Step 4
Step 5
 Done! ✅
Pass attribution token from the app to Apphud.
Don't get confused between appleAdsAttribution and appleSearchAds enum cases!
1
private func trackAppleSearchAds() {
2
if #available(iOS 14.3, *) {
3
DispatchQueue.global(qos: .default).async {
4
if let token = try? AAAttribution.attributionToken() {
5
DispatchQueue.main.async {
6
Apphud.addAttribution(data: nil, from: .appleAdsAttribution, identifer: token, callback: nil)
7
}
8
}
9
}
10
} else {
11
// optionally send Search Ads attribution data from older iOS versions
12
ADClient.shared().requestAttributionDetails { data, _ in
13
data.map { Apphud.addAttribution(data: $0, from: .appleSearchAds, callback: nil) }
14
}
15
}
16
}
Copied!
Go to Apphud Settings > Search Ads Settings. There you will see a Public Key value. There are two options. You need to do of this: 1. Use Apphud auto-generated keys pair. In this case just copy Public Key value. or 2. Generate your own private key and paste it by clicking a corresponding link. After that copy Public Key value. See the picture below.
In your Apple Search Ads account go to Settings > User Management page. In order for Apphud to fetch attribution data you need to invite another Apple ID account and grant it API Account Manager access.
For unknown reason, granting API Account Read Only role doesn't work. Please grant Account Manager role as described.
    Log out from your primary Search Ads Account
    Log in to Apple Search Ads with Apple ID that has API access that you invited from the step 3.
    Go to Settings > API and paste your public key to generate credentials.
    Copy Client ID, Team ID, and Key ID fields.
Go to Apphud Settings > Search Ads Settings and fill all the fields. If all done correctly Access Token field with Organisations list will show up in the page:
Click Save and you're al set!

Apple Search Ads Attribution via iAd framework

This is the old way to get attribution data and is deprecated since iOS 14.5. Integration is very simple. Just import iAd framework and call the following method at any point:
Swift
Objective-C
1
import iAd
2
3
func fetchAppleSearchAdsAttrubutionData() {
4
ADClient.shared().requestAttributionDetails { data, _ in
5
data.map { Apphud.addAttribution(data: $0, from: .appleSearchAds, callback: nil) }
6
}
7
}
Copied!
1
#import <iAd/iAd.h>
2
3
- (void) fetchAppleSearchAdsAttrubutionData {
4
[[ADClient sharedClient] requestAttributionDetailsWithBlock:^(NSDictionary<NSString *,NSObject *> * _Nullable attributionDetails, NSError * _Nullable error) {
5
if (attributionDetails != nil) {
6
[Apphud addAttributionWithData:attributionDetails from:ApphudAttributionProviderAppleSearchAds identifer:nil callback:nil];
7
}
8
}];
9
}
Copied!

View Apple Search Ads Attribution Data in Apphud

Regardless of what of two methods you use you can view attribution data from Apple Search Ads in Apphud charts or in user page.
Last modified 1mo ago