Adopture Docs
SDKsReact Native

Revenue Tracking

Track purchases, subscriptions, and revenue events with the Adopture React Native SDK.

Quick Start

import { Adopture } from '@adopture/react-native';

Adopture.trackPurchase({
  productId: 'pro_monthly',
  price: 9.99,
  currency: 'USD',
  transactionId: 'txn_abc123',
});

Available Methods

Initial Purchase

Track a first purchase or new subscription:

Adopture.trackPurchase({
  productId: 'pro_monthly',
  price: 9.99,
  currency: 'USD',
  transactionId: 'txn_abc123',
});

One-Time Purchase

Track a non-recurring purchase:

Adopture.trackOneTimePurchase({
  productId: 'premium_icon_pack',
  price: 4.99,
  currency: 'USD',
  transactionId: 'txn_def456',
});

Subscription Renewal

Adopture.trackRenewal({
  productId: 'pro_monthly',
  price: 9.99,
  currency: 'USD',
});

Trial Started

Adopture.trackTrialStarted({
  productId: 'pro_monthly',
  expirationAt: '2026-05-08T00:00:00Z',
});

Trial Converted

Adopture.trackTrialConverted({
  productId: 'pro_monthly',
  price: 9.99,
  currency: 'USD',
});

Cancellation

Adopture.trackCancellation({
  productId: 'pro_monthly',
});

Refund

Adopture.trackRefund({
  productId: 'pro_monthly',
  price: 9.99,
  currency: 'USD',
});

Full Example

For complete control, use trackRevenue() with a RevenueData object:

Adopture.trackRevenue({
  event_type: 'INITIAL_PURCHASE',
  product_id: 'pro_yearly',
  price: 79.99,
  currency: 'USD',
  quantity: 1,
  transaction_id: 'txn_xyz789',
  store: 'APP_STORE',
  is_trial: false,
  period_type: 'yearly',
  expiration_at: '2027-04-08T00:00:00Z',
});

Revenue Event Types

TypeDescription
INITIAL_PURCHASEFirst purchase or new subscription
NON_RENEWING_PURCHASEOne-time, non-recurring purchase
RENEWALSubscription renewal
TRIAL_STARTEDFree trial begins
TRIAL_CONVERTEDTrial converted to paid subscription
CANCELLATIONSubscription cancelled
REFUNDRefund processed

Supported Stores

StoreValue
Apple App StoreAPP_STORE
Google Play StorePLAY_STORE
StripeSTRIPE
OtherOTHER

The SDK auto-detects the store based on the platform (iOS → APP_STORE, Android → PLAY_STORE). Override this when tracking server-side or Stripe purchases.

Currency

Use ISO 4217 currency codes: USD, EUR, GBP, etc. Prices should be in the base unit (e.g. 9.99, not cents).

Server-Side Tracking

For server-side revenue events (e.g. from RevenueCat webhooks), see Revenue Events.

On this page