Docs
grovs.io Start for free

Revenue

Log purchases from your web app with the Grovs SDK.

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

Purchase events need a Grovs Enterprise backend (GROVS_EE=true) on every platform. Grovs cloud runs Enterprise. On self-hosted Community edition the endpoint doesn't exist, and logCustomPurchase reports eventDispatchFailed naming the requirement instead of retrying.

Setup

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

See Revenue for the dashboard and Goals for revenue goals.

Logging purchases

The web has no StoreKit or Play Billing, so every web payment is a custom purchase:

javascript
await Grovs.logCustomPurchase({
  type: "buy",                  // "buy" | "cancel" | "refund" | "refund_reversed"
  priceInCents: 1999,
  currency: "USD",
  productID: "com.acme.coins.100",
  startDate: new Date(),        // optional, defaults to now
  transactionID: "order-8842",  // optional, but pass yours
});

Resolves true when the purchase was recorded. It resolves false without sending while the SDK is disabled, and before authentication completes (reported as eventDispatchFailed). A purchase that fails isn't stored for a later retry, so send it again with the same transactionID.

FieldTypeDescription
typeTransactionType"buy", "cancel", "refund" or "refund_reversed"
priceInCentsnumberAmount in cents, for example 999 for $9.99
currencystringISO 4217 currency code
productIDstringYour product identifier
startDateDateTransaction date. Defaults to now. An invalid date reports through onError
transactionIDstringYour order or payment id. See below

Transaction ids

The backend deduplicates on transaction id. Pass your own order or payment id and repeats are safe: a retry after a timeout or a double-submitted checkout counts once. If omitted, the SDK mints one per call. That covers its own network retries but can't recognize the same purchase sent from a later page load.

Next steps

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