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
- Open the Grovs dashboard
- Go to your project's Settings
- 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:
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:
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:
| Parameter | Type | Description |
|---|---|---|
type | TransactionType | .buy, .cancel, or .refund |
priceInCents | int | Amount in cents (e.g. 999 for $9.99) |
currency | String | ISO 4217 currency code (e.g. "USD", "EUR") |
productId | String | Your product identifier |
startDate | DateTime? | Transaction date. Defaults to now |
Tracking cancellations and refunds
// 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.