Attribution tells you how users discovered your app. SpendOwl fetches attribution data from Apple Search Ads and enriches it with campaign, ad group, and keyword details.
Attribution is automatically fetched when you call configure(). For most apps, you don’t need to do anything else—the data flows to your dashboard automatically.
Use the attribution() method to access attribution data in your app:
async/await
Completion Handler
Task { do { let attribution = try await SpendOwl.attribution() switch attribution.status { case .attributed: print("Campaign: \(attribution.campaignName ?? "unknown")") print("Keyword: \(attribution.keyword ?? "unknown")") case .organic: print("Organic install") case .unknown: print("Attribution pending") } } catch { print("Error: \(error)") }}
SpendOwl.attribution { result in switch result { case .success(let attribution): if attribution.status == .attributed { print("Campaign: \(attribution.campaignName ?? "unknown")") } case .failure(let error): print("Error: \(error)") }}
The AttributionResult struct contains all available attribution data:
public struct AttributionResult { let id: String // Unique attribution ID let status: AttributionStatus // .attributed, .organic, or .unknown // Campaign data (only when status == .attributed) let campaignId: Int? let campaignName: String? let adGroupId: Int? let adGroupName: String? let keywordId: Int? let keyword: String? // Additional data let countryOrRegion: String? // "US", "GB", "JP", etc. let clickDate: Date? // When the ad was clicked let conversionType: String? // "Download" or "Redownload" let supplyPlacement: String? // Ad placement type}