Docs

Revenue

Track in-app purchases and custom payments with the Grovs Flutter SDK

Revenue tracking lets you attribute purchases to links and campaigns, monitor metrics like ARPU and LTV, and view breakdowns by product and platform — all from the Grovs dashboard.

Revenue tracking is currently in beta.

Setup

1. Enable revenue tracking in the dashboard

  1. Open the Grovs dashboard
  2. Go to your project's Settings
  3. Under Revenue Tracking, click Enable

2. Configure platform notifications

  • Android — Set up Google Play Real-Time Developer Notifications. See the Android Revenue guide for details.
  • iOS — Configure App Store Server Notifications in App Store Connect. Set the production and sandbox URLs shown in the Grovs dashboard under Developers → iOS Setup → Revenue.

Logging purchases

Platform store purchases

For purchases made through the App Store or Google Play, pass the platform-specific transaction identifier:

Dart
import 'package:grovs_flutter_plugin/grovs.dart';
 
final grovs = Grovs();
 
// iOS: pass the StoreKit transaction ID as a string
// Android: pass the purchase originalJson string
await grovs.logInAppPurchase('transaction_id_or_json');

The SDK automatically routes to the correct native implementation. Duplicates are filtered — you can safely call this method without worrying about double-counting.

Custom purchases

For purchases processed through Stripe, PayPal, or any non-store payment system:

Dart
import 'package:grovs_flutter_plugin/models/grovs_link.dart';
 
await grovs.logCustomPurchase(
  type: TransactionType.buy,
  priceInCents: 999,       // $9.99
  currency: 'USD',
  productId: 'premium_monthly',
);

Parameters:

ParameterTypeDescription
typeTransactionType.buy, .cancel, or .refund
priceInCentsintAmount in cents (e.g. 999 for $9.99)
currencyStringISO 4217 currency code (e.g. "USD", "EUR")
productIdStringYour product identifier
startDateDateTime?Transaction date. Defaults to now

Tracking cancellations and refunds

Dart
// Log a cancellation
await grovs.logCustomPurchase(
  type: TransactionType.cancel,
  priceInCents: 999,
  currency: 'USD',
  productId: 'premium_monthly',
);
 
// Log a refund
await grovs.logCustomPurchase(
  type: TransactionType.refund,
  priceInCents: 999,
  currency: 'USD',
  productId: 'premium_monthly',
);

For App Store and Google Play purchases, cancellations and refunds are detected automatically when you configure platform server notifications.