Skip to main content

Overview

SpendOwl automatically observes StoreKit 2 transactions to track revenue for ROAS calculation. This works passively alongside other subscription SDKs like RevenueCat or Adapty.

Automatic Tracking

Purchase tracking starts automatically when you call configure():
SpendOwl.configure(apiKey: "your-api-key")
// Purchase tracking is now active
No additional code required. SpendOwl observes all StoreKit 2 transactions automatically.

How It Works

  1. User completes a purchase through StoreKit 2
  2. SpendOwl receives the transaction notification
  3. Transaction data (product ID, price, currency) is extracted
  4. Revenue event is sent to SpendOwl servers
  5. ROAS is calculated and displayed in your dashboard

Tracked Transaction Types

TypeTrackedNotes
ConsumablesYesOne-time purchases
Non-consumablesYesLifetime purchases
Auto-renewable subscriptionsYesInitial and renewals
Non-renewing subscriptionsYesOne-time subscriptions
RefundsYesNegative revenue
Family SharingYesShared purchases

Currency Handling

SpendOwl handles currency conversion automatically:
  • Prices are captured in the user’s local currency
  • Converted to USD using current exchange rates
  • ROAS is always displayed in USD for consistency
Exchange rates are updated daily from European Central Bank data.

Works with Other SDKs

SpendOwl uses passive observation and doesn’t interfere with:
  • RevenueCat — Both can observe the same transactions
  • Adapty — No conflicts
  • Qonversion — Works alongside
  • Custom StoreKit code — No changes needed
// Your existing purchase flow
let result = try await product.purchase()

// SpendOwl automatically observes this
// RevenueCat/Adapty also work normally

Revenue Attribution

Purchases are attributed to campaigns:
  1. User installs from an Apple Search Ads campaign
  2. Attribution is captured by SpendOwl
  3. User makes a purchase (days or weeks later)
  4. Revenue is linked to the original campaign
This enables accurate ROAS calculation: Revenue / Ad Spend = ROAS

User ID Linking

When a user ID is set, purchases are linked to that user:
// User logs in
SpendOwl.setUserId("user-123")

// Any purchase is now attributed to "user-123"
let result = try await product.purchase()
See User Identity for more details.

Server-Side Validation

All transactions are validated server-side:
  • Transaction receipts are verified with Apple
  • Fraudulent transactions are filtered
  • Only valid revenue counts toward ROAS

Debugging Purchases

Enable logging to see purchase events:
SpendOwl.enableLogging = true

// Purchase logs will appear in console:
// [SpendOwl] Purchase tracked: com.app.premium ($9.99 USD)
See Debugging for more logging options.

FAQ

No. SpendOwl observes transactions automatically. Just ensure the SDK is configured before purchases occur.
Sandbox purchases are tracked separately and don’t affect production ROAS. Use a test API key in development.
SpendOwl uses StoreKit 2 only. If your app uses StoreKit 1, transactions are not tracked. Consider migrating to StoreKit 2.
Auto-renewal transactions are tracked just like initial purchases. Each renewal adds to the user’s LTV.
Yes. Refunds are recorded as negative revenue and reduce the ROAS for the associated campaign.

Next Steps