# How to send Apple Ads attribution data to RevenueCat

> Set up the Apple Ads (Search Ads) integration in RevenueCat and send the AdServices token from Flutter, Swift or React Native to see revenue per keyword.

Source: https://adskitty.com/docs/apple-ads-attribution-revenuecat · Updated 20 November 2026

## Short answer

To get Apple Ads attribution in RevenueCat, do two things. First, add the integration in your RevenueCat project under **Integrations › Apple AdServices**, and connect your Apple Ads Advanced account with **Sign in with Apple** so campaign and keyword names come through. Then call `enableAdServicesAttributionTokenCollection()` in your app right after you configure the Purchases SDK. No App Tracking Transparency prompt is needed. Attribution appears within about 24 hours of a new customer, and can take up to 7 days for a new campaign.

## What Apple Ads attribution in RevenueCat is

Apple Ads (called Apple Search Ads until 2025) puts your app at the top of App Store search results. Apple Ads reports taps, installs and cost per install, but it never learns who subscribed, renewed or asked for a refund. RevenueCat knows all of that, but on its own it doesn't know where a customer came from.

Apple's **AdServices** framework connects the two. When someone installs your app from an ad, your app can ask iOS for an anonymous attribution token. RevenueCat sends that token to Apple, and Apple answers with the campaign, ad group and keyword that brought the install. RevenueCat saves the answer on the customer, so everything that customer pays later counts for that campaign and keyword.

## Why it matters

- **Revenue per campaign and keyword, not just installs.** A keyword with cheap installs that never pay costs you more than an expensive one that brings subscribers. Without attribution you can't tell them apart.
- **ROAS you can act on.** With revenue next to spend, you can see which keywords pay back, raise their bids, and stop paying for the ones that don't.
- **Smarter automation.** Tools that manage Apple Ads for revenue, such as [AdsKitty's nightly manager](https://adskitty.com/docs/autonomous-apple-ads-campaign-management), read this data from RevenueCat. Without it, they can only optimize for installs.

## What you need before you start

- A RevenueCat project with your iOS app in it, and the RevenueCat Purchases SDK already set up in the app.
- Devices on **iOS 14.3 or later**. AdServices doesn't exist before that, so older devices aren't attributed.
- An Apple Ads account. To see **campaign, ad group and keyword names** you need **Apple Ads Advanced**. Installs from Apple Ads Basic are attributed to Apple Ads, but show as "Unspecified".
- An Apple Ads user who is an **Account Admin** or **Campaign Group Manager**, to let RevenueCat read your campaigns.

## Step 1: Turn on the Apple Ads integration in RevenueCat

1. Open your project in the RevenueCat dashboard.
2. Under **Integrations**, choose **Apple AdServices**.
3. Click **Add Apple Search Ads integration**.
4. If you use Apple Ads Advanced: in the **Advanced integration** section, click **Sign in with Apple**, sign in with your Apple Ads account and allow access. **Read Only** access is enough. Read and Write works too, and Limited Access works only if it includes every campaign group you advertise from.
5. Back in RevenueCat, check that the integration shows as connected.

> **Match your Apple Ads plan.** Set the integration up for the plan you actually use. If an Advanced account isn't connected, RevenueCat still knows a customer came from Apple Ads, but not which campaign, ad group or keyword.

If you connected RevenueCat a while ago with a client ID, team ID and key ID, that older setup keeps working, but RevenueCat recommends moving to Sign in with Apple. If someone revokes RevenueCat's access in Apple Ads, connect it again in RevenueCat to resume.

## Step 2: Send the attribution token from your app

The dashboard alone collects nothing. Your app has to collect the AdServices token and hand it to RevenueCat. It's one call, made right after you configure the Purchases SDK, and the SDK sends the token in the background.

Use your **public** Apple API key here, the one that starts with `appl_`. Never put a secret key (`sk_`) in an app.

| Platform | Package | Call after configure |
| --- | --- | --- |
| Flutter | purchases_flutter | `Purchases.enableAdServicesAttributionTokenCollection()` |
| Swift / SwiftUI | RevenueCat (purchases-ios) | `Purchases.shared.attribution.enableAdServicesAttributionTokenCollection()` |
| Objective-C | RevenueCat (purchases-ios) | `[purchases.attribution enableAdServicesAttributionTokenCollection]` |
| React Native / Expo | react-native-purchases | `Purchases.enableAdServicesAttributionTokenCollection()` |
| Capacitor / Ionic | @revenuecat/purchases-capacitor | `Purchases.enableAdServicesAttributionTokenCollection()` |
| Cordova | cordova-plugin-purchases | `Purchases.enableAdServicesAttributionTokenCollection()` |

### Flutter

Configure Purchases in `main()`, then turn on token collection. The check keeps the call on iOS, where Apple Ads runs.

```dart
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:purchases_flutter/purchases_flutter.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  if (!kIsWeb && defaultTargetPlatform == TargetPlatform.iOS) {
    await Purchases.configure(PurchasesConfiguration('appl_your_public_api_key'));
    // Apple Ads attribution: collect the AdServices token and send it to RevenueCat.
    await Purchases.enableAdServicesAttributionTokenCollection();
  }

  runApp(const MyApp());
}
```

### Swift (UIKit)

In your app delegate, straight after `Purchases.configure`:

```swift
import RevenueCat
import UIKit

@main
final class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        Purchases.configure(withAPIKey: "appl_your_public_api_key")
        // Apple Ads attribution: collect the AdServices token and send it to RevenueCat.
        Purchases.shared.attribution.enableAdServicesAttributionTokenCollection()
        return true
    }
}
```

### SwiftUI

A SwiftUI app has no app delegate by default, so configure RevenueCat in the app's initializer:

```swift
import RevenueCat
import SwiftUI

@main
struct MyApp: App {
    init() {
        Purchases.configure(withAPIKey: "appl_your_public_api_key")
        Purchases.shared.attribution.enableAdServicesAttributionTokenCollection()
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
```

### Objective-C

```objc
RCPurchases *purchases = [RCPurchases configureWithAPIKey:@"appl_your_public_api_key"];
[purchases.attribution enableAdServicesAttributionTokenCollection];
```

### React Native and Expo

```javascript
import { Platform } from 'react-native';
import Purchases from 'react-native-purchases';

if (Platform.OS === 'ios') {
  Purchases.configure({ apiKey: 'appl_your_public_api_key' });
  Purchases.enableAdServicesAttributionTokenCollection();
}
```

### Capacitor and Ionic

```typescript
import { Capacitor } from '@capacitor/core';
import { Purchases } from '@revenuecat/purchases-capacitor';

if (Capacitor.getPlatform() === 'ios') {
  await Purchases.configure({ apiKey: 'appl_your_public_api_key' });
  await Purchases.enableAdServicesAttributionTokenCollection();
}
```

### Cordova

```javascript
Purchases.configureWith({ apiKey: 'appl_your_public_api_key' });
Purchases.enableAdServicesAttributionTokenCollection();
```

Other RevenueCat SDKs, such as Unity and Kotlin Multiplatform, have the same call under a similar name. Check that SDK's reference.

## Do you need App Tracking Transparency?

No. **Standard attribution needs no consent**, and it already includes the campaign, ad group and keyword. You don't need to show the tracking prompt to get revenue per keyword.

If your app asks for tracking anyway, for example because it shows personalized ads, Apple can return **detailed** attribution for people who allow it, which adds the click date. To get it, call `enableAdServicesAttributionTokenCollection()` after the person has answered the tracking prompt. A token collected before the answer only carries standard data.

```swift
import AppTrackingTransparency
import RevenueCat

Purchases.configure(withAPIKey: "appl_your_public_api_key")
if ATTrackingManager.trackingAuthorizationStatus != .notDetermined {
    // Already answered on an earlier launch.
    Purchases.shared.attribution.enableAdServicesAttributionTokenCollection()
}

// Later, where your app asks for tracking:
ATTrackingManager.requestTrackingAuthorization { _ in
    Purchases.shared.attribution.enableAdServicesAttributionTokenCollection()
}
```

In Flutter, with the app_tracking_transparency package:

```dart
import 'package:app_tracking_transparency/app_tracking_transparency.dart';
import 'package:purchases_flutter/purchases_flutter.dart';

Future<void> collectAppleAdsAttribution() async {
  if (await AppTrackingTransparency.trackingAuthorizationStatus == TrackingStatus.notDetermined) {
    await AppTrackingTransparency.requestTrackingAuthorization();
  }
  await Purchases.enableAdServicesAttributionTokenCollection();
}
```

## Step 3: Check that it works

- **Give it time.** RevenueCat asks Apple for each new customer's attribution within 24 hours. For a new campaign, or a newly set up integration, allow up to 7 days.
- **Look at a customer.** A customer who came from an ad has the attributes `$mediaSource`, `$campaign`, `$adGroup` and `$keyword`.
- **Look at Charts.** Charts can be filtered and segmented by **Attribution source** (Apple Search Ads or Organic), **Apple search ads campaign**, **Apple search ads group**, **Apple search ads keyword**, and **Apple search ads claim type**: Click for people who tapped an ad, Impression for people who only saw one.
- **Don't judge it from TestFlight.** In debug builds and TestFlight, Apple may return placeholder or empty attribution, which shows as "Unspecified". Real data comes from App Store installs.

## Common problems

- **Everything shows as "Unspecified".** Your Apple Ads account is Basic, the Advanced integration isn't connected with Sign in with Apple, or you're looking at debug or TestFlight installs.
- **No Apple Ads customers at all.** The SDK call is missing (setting up the dashboard alone collects nothing), the version with the call isn't live yet, or the devices are older than iOS 14.3. Customers only get attributed once they open a version of your app that makes the call.
- **Ad groups with age or gender targeting get no attribution.** Apple's AdServices returns no attribution for installs from ad groups that target by age or gender. Remove that targeting if you need the data.
- **Data stopped coming in.** Someone revoked RevenueCat's access in Apple Ads. Connect it again in RevenueCat.

## How AdsKitty uses this data

[AdsKitty](https://adskitty.com/) puts your Apple Ads spend and your RevenueCat revenue side by side. If you haven't connected Apple Ads to AdsKitty yet, start with [creating an Apple Ads API key](https://adskitty.com/docs/apple-ads-api-key-setup). Once attribution flows into RevenueCat, connect RevenueCat in AdsKitty with a V2 secret API key that has read access to **Charts & metrics**. This key stays on AdsKitty's servers, encrypted, and is separate from the public key in your app.

AdsKitty then shows revenue, ROAS and conversion to paying for every campaign and keyword, counting the people who tapped your ad. Its [nightly manager](https://adskitty.com/docs/autonomous-apple-ads-campaign-management) uses the same data to steer managed campaigns toward revenue rather than installs, and it needs the Advanced integration's campaign and keyword names to do that.

## Frequently asked questions

### Do I need App Tracking Transparency for Apple Ads attribution in RevenueCat?

No. Standard attribution works without the tracking prompt and already includes the campaign, ad group and keyword. Tracking consent only adds detailed data, such as the date of the tap.

### Does RevenueCat's Apple Ads attribution work with Apple Ads Basic?

Partly. RevenueCat can tell that a customer came from Apple Ads, but Apple doesn't provide campaign, ad group or keyword names for Basic, so they show as "Unspecified".

### Is Apple Search Ads the same as Apple Ads?

Yes. Apple renamed Apple Search Ads to Apple Ads in 2025. RevenueCat's dashboard and charts still use the name Apple Search Ads in places.

### How long does it take for Apple Ads attribution to show up in RevenueCat?

RevenueCat requests attribution from Apple within 24 hours of a new customer. For a new campaign or a newly set up integration, allow up to 7 days.

### Where do I call enableAdServicesAttributionTokenCollection?

Right after you configure the Purchases SDK, when the app starts. In Flutter that's usually `main()`, in UIKit `application(_:didFinishLaunchingWithOptions:)`, and in SwiftUI the app's `init()`.

### Does Apple Ads attribution work on Android?

No. Apple Ads only promotes apps on Apple's App Store, and AdServices is an Apple framework. Make the call on iOS only.

### Can I see revenue for each Apple Ads keyword?

Yes. In RevenueCat Charts, segment by Apple search ads keyword. AdsKitty also shows revenue and ROAS for every keyword next to its spend, bid and installs.
