Adopture Docs
SDKsFlutter

Revenue Tracking

Track in-app purchases and subscriptions with the Adopture Flutter SDK.

The Adopture SDK includes built-in support for tracking purchases, subscriptions, trials, and refunds. Revenue data appears in your dashboard's Revenue section.

Quick Start

Track a purchase with a single call:

Adopture.trackPurchase(
  productId: 'pro_monthly',
  price: 9.99,
  currency: 'USD',
);

Available Methods

MethodUse Case
trackPurchase()Initial purchase (subscription or one-time)
trackOneTimePurchase()Non-recurring purchase
trackRenewal()Subscription renewal
trackTrialStarted()Free trial begins
trackTrialConverted()Trial converts to paid
trackCancellation()Subscription canceled
trackRefund()Refund processed

Full Example

For complete control over revenue event data, use trackRevenue() with a RevenueData object:

Adopture.trackRevenue(RevenueData(
  eventType: RevenueEventType.initialPurchase,
  productId: 'pro_monthly',
  price: 9.99,
  currency: 'USD',
  quantity: 1,
  transactionId: 'txn_abc123',
  store: Store.appStore,
  isTrial: false,
  isTrialConversion: false,
  periodType: 'NORMAL',
  expirationAt: '2025-02-01T00:00:00Z',
));

Supported Stores

The store field accepts the following values:

  • Store.appStore — Apple App Store
  • Store.playStore — Google Play Store
  • Store.stripe — Stripe
  • Store.other — Any other payment provider

Currency

Use ISO 4217 three-letter currency codes: USD, EUR, GBP, JPY, etc.

Server-Side Revenue Tracking

For more reliable revenue tracking that does not depend on the client, use the RevenueCat integration. RevenueCat sends purchase events directly from its servers, ensuring you never miss a transaction even if the user closes the app immediately after purchasing.

On this page