Skip to main content

1. Install the SDK

Add SpendOwl to your project using Swift Package Manager:
https://github.com/spendowl/spendowl-ios
1

Open Your Project

In Xcode, go to File → Add Package Dependencies…
2

Enter the URL

Paste https://github.com/spendowl/spendowl-ios
3

Add to Target

Select your app target and click Add Package

2. Configure on App Launch

import SwiftUI
import SpendOwl

@main
struct MyApp: App {
    init() {
        SpendOwl.configure(apiKey: "your-api-key")
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
Get your API key from the SpendOwl Dashboard.

3. That’s It!

SpendOwl now:
  • Fetches attribution data from Apple Search Ads
  • Tracks StoreKit 2 purchases automatically
  • Sends data to your dashboard for ROAS calculation

Optional: Get Attribution Data

Access attribution data to display campaign info or for analytics:
Task {
    do {
        let attribution = try await SpendOwl.attribution()
        print("Campaign: \(attribution.campaignName ?? "organic")")
    } catch {
        print("Error: \(error)")
    }
}
Associate attribution and purchases with your user accounts:
// After user logs in
SpendOwl.setUserId("user-123")

// On logout
SpendOwl.clearUserId()

Next Steps