Revenue
Attach money to an event
Add revenue and currency to any custom event and Viakite counts the money it brought in. You then see revenue over time, by source, and the average order value, next to the visitors who made it.
Taking payments with Stripe, Razorpay or Dodo Payments? Connect the provider instead, and each payment becomes revenue without a track call. With Stripe or Dodo Payments you also get MRR and churn from your subscriptions.
Send revenue
Put revenue (a number) and currency (a 3-letter ISO code) in the event's properties:
1import { track } from "@viakite/sdk";23track("Purchase", { revenue: 499, currency: "INR", product: "Pro yearly" });
1viakite.track("Purchase", { revenue: 499, currency: "INR", product: "Pro yearly" });
Send it once, when the payment has succeeded: on your thank-you page or after your checkout's success callback. Any event name works; Purchase, Order placed and Subscribed are common.
The rules
| Field | Rule | If it breaks the rule |
|---|---|---|
revenue | A number, in the currency's main unit: 499 for ₹499, 19.99 for $19.99 | Dropped, with a warning |
currency | 3 letters, an ISO 4217 code such as INR, USD, EUR; case doesn't matter, it is stored in capitals | Dropped, with a warning |
revenue and currency don't count against the 20 properties of an event, and you can add other properties next to them. A revenue sent as text ("499") is dropped, so convert it first. In debug mode each drop shows in the browser console; see Debugging.
Where it shows
Open Analytics → Revenue. For the date range you pick it shows:
- Revenue: the sum of
revenueover every event in the range, in the project's currency. - Orders: how many events carried a revenue other than 0.
- Average order value: revenue divided by the events that carried a revenue other than 0.
- A chart of revenue over time, compared with the period before.
- Revenue by source: which sources brought the paying visitors, with each one's change against the period before. Click a row to filter the page by it.
- Breakdown: revenue, average order value, conversions and visitors by any one or two dimensions you pick, such as Source then UTM campaign, with its own Export CSV.
Every visit keeps the source of its first page view, so a purchase made three pages after landing from Instagram counts for Instagram. Amounts are shown in the project's currency, which you pick when you create the project.
Through the API, revenue and average_order_value are measures of the query endpoint, and you can break them down by any dimension: page, campaign, country, device.
MRR and churn
When Stripe or Dodo Payments is connected with its subscription events, the Revenue page also shows your subscriptions, for the date range you pick:
- MRR: what paying subscriptions are worth a month when the range ends, against when it starts. A yearly plan counts a twelfth of its price, a weekly one 52 twelfths.
- Subscribers: paying subscriptions when the range ends, against when it starts.
- New MRR: what the subscriptions that first paid in the range are worth now, and how many there are.
- Churn rate: subscriptions that paid and ended in the range, over those paying when it started, with the MRR they had.
- MRR over time: MRR at the end of each day, week or month.
- MRR by source: the same numbers by the channel, source or campaign of each subscriber's last visit before subscribing. Subscribers Viakite never saw (no
viakite_user_id, or no visit in the 30 days before) show as Not tied to a visit. - MRR by plan: by the price's nickname (or lookup key, else the product id) on Stripe, and by the product id on Dodo Payments.
A subscription counts from when it starts paying (Stripe active or past_due, Dodo active or past_due) until it ends; trials, paused, on-hold and unpaid ones count 0. Amounts are converted to the project's currency at the rate of the range's last day. Test-mode Stripe subscriptions are left out.
What MRR doesn't count yet
The page's filters don't apply to MRR. Razorpay subscriptions aren't read. On Stripe, tiered and metered prices count 0 and discounts aren't taken off. A subscription in a currency without an exchange rate counts 0, and the page says which currencies.
Through the API, POST /v1/projects/{project}/analytics/mrr returns the same numbers, with date_range, breakdown (channel, source, referrer_domain, utm_source, utm_medium, utm_campaign or plan) and granularity (day, week, month or auto).
Several currencies
Send each sale in the currency it was paid in. Viakite keeps the amount and currency you sent, and shows revenue in the project's currency, converted at the rate of the day the event happened (in UTC). On weekends and holidays, and for today before the day's rates are out, the last rate before it is used.
Rates are the daily reference rates of the European Central Bank, which cover about 30 currencies, among them USD, EUR, GBP, INR, JPY, AUD, CAD and SGD. An event with no currency is counted as if it were in the project's currency.
Currencies without a rate are left out
Revenue in a currency the European Central Bank has no rate for (such as AED) is left out of revenue and the average order value, never added as if it were in the project's currency. Through the API, the answer then carries a missing_exchange_rate warning naming those currencies (see queries); the Revenue page doesn't show that warning yet. For those currencies, convert before you call track.
The Goals page shows the revenue behind each event goal in its Revenue column, and a goal's own page shows its revenue over time.