Docs
grovs.io Start for free

Revenue

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

Log purchases to attribute revenue to links and campaigns, and see ARPU, LTV and product and platform breakdowns in the dashboard.

Revenue tracking is in beta. Currency conversion rates may show minor discrepancies.

Self-hosted: revenue tracking needs the Enterprise edition (GROVS_EE=true). A Community edition backend has no purchase endpoint, so calls report failure.

Setup

1. Enable revenue tracking in the dashboard

  1. In the Grovs dashboard, go to Analytics → Revenue.
  2. Click Enable Revenue Tracking. Only instance admins can turn it on or off.

Revenue is collected only while this setting is on. See Revenue for the dashboard and Goals for revenue goals.

2. Configure App Store Server Notifications

Required. In-app purchase tracking doesn't work without this step. Grovs gets transaction data from Apple through App Store Server Notifications.

In App Store Connect:

  1. Select your app and open App Information.
  2. Scroll to App Store Server Notifications.
  3. Set Production Server URL to the URL in the Grovs dashboard under Developers → iOS Setup → Revenue.
  4. Set Sandbox Server URL to the sandbox URL in the same section.

Already handle these notifications on your server? Forward the events to the Grovs URLs instead.

Logging purchases

Use logInAppPurchase for Apple In-App Purchases and logCustomPurchase for any other payment flow.

App Store purchases (StoreKit 2)

Pass the StoreKit 2 transaction ID:

Swift
import StoreKit
 
// After a successful purchase
let result = try await Product.purchase(...)
 
if case .success(let verification) = result,
   case .verified(let transaction) = verification {
 
    Grovs.logInAppPurchase(transactionID: transaction.id) { success in
        if success {
            // Revenue event recorded
            Task { await transaction.finish() }
        }
    }
}

The SDK sends only the transaction ID. Grovs looks it up through the App Store Server API, using the key configured in the dashboard, and fills in product, price, currency and dates. App Store Server Notifications then keep renewals, cancellations and refunds current, so both setup steps are required. An already-logged transaction ID is skipped, so repeat calls never double-count.

The SDK method runs on iOS 13. The StoreKit 2 code that provides transaction.id needs iOS 15.

Completion result

Both methods save the purchase on the device before sending it, including before authentication completes. The completion gets true once it's sent. Once the SDK is configured and enabled, false means the purchase is kept and retried at later foregrounds (up to 20 attempts), so don't log it again: a second logCustomPurchase call is a second purchase. Before configure, or while the SDK is disabled, nothing is saved and the completion gets false.

Custom purchases

For purchases through your own server, Stripe or any non-IAP system:

Swift
Grovs.logCustomPurchase(
    type: .buy,
    priceInCents: 999,       // $9.99
    currency: "USD",
    productID: "premium_monthly"
) { success in
    // Revenue event recorded
}

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
startDateDate?Transaction date. Defaults to now

Tracking cancellations and refunds

Log cancellations and refunds with .cancel and .refund:

Swift
// Log a cancellation
Grovs.logCustomPurchase(
    type: .cancel,
    priceInCents: 999,
    currency: "USD",
    productID: "premium_monthly"
) { success in }
 
// Log a refund
Grovs.logCustomPurchase(
    type: .refund,
    priceInCents: 999,
    currency: "USD",
    productID: "premium_monthly"
) { success in }

App Store cancellations and refunds are detected automatically through App Store Server Notifications.

Dashboard metrics

MetricMeaning
Total RevenueAggregate revenue with currency conversion
ARPUAverage revenue per user
ARPPUAverage revenue per paying user
LTVLifetime value per product
Units SoldTotal purchases
First-time vs. Repeat PurchasesNew vs. returning customers
CancellationsCancelled transactions

Filter every metric by date range, platform and product.

Last updated 2026-10-27
Was this page helpful?