Revenue
Track in-app purchases and custom payments with the Grovs React Native 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 Grovs from 'react-native-grovs-wrapper';
// iOS: pass the StoreKit 2 transaction ID as a string
// Android: pass the Google Play purchase.originalJson string
try {
const success = await Grovs.logInAppPurchase(transactionId);
console.log('Purchase tracked:', success);
} catch (error) {
console.error('Error tracking purchase:', error);
}The SDK automatically routes to the correct native implementation. Duplicates are filtered.
Custom purchases
For purchases processed through Stripe, PayPal, or any non-store payment system:
try {
const success = await Grovs.logCustomPurchase(
'buy', // type: 'buy' | 'cancel' | 'refund'
999, // priceInCents: $9.99
'USD', // currency code
'premium_monthly', // product identifier
);
console.log('Custom purchase tracked:', success);
} catch (error) {
console.error('Error:', error);
}Parameters:
| Parameter | Type | Description |
|---|---|---|
type | TransactionType | 'buy', 'cancel', or 'refund' |
priceInCents | number | 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 | string? | Optional ISO 8601 date string. Defaults to now |
Tracking cancellations and refunds
// Log a cancellation
await Grovs.logCustomPurchase('cancel', 999, 'USD', 'premium_monthly');
// Log a refund
await Grovs.logCustomPurchase('refund', 999, 'USD', 'premium_monthly');For App Store and Google Play purchases, cancellations and refunds are detected automatically when you configure platform server notifications.