Revenue ledger
get_revenue_ledgerScore every campaign and creator code by the advertiser's own revenue events, not the ad network's report: spend, trials, people who actually paid, take-home revenue and payback (revenue ÷ spend). Measured, aggregated and self-reported figures are kept in separate fields; networks without per-person attribution show only an upper bound from signup answers. Campaign rows and total cover the requested days (ad platform spend, and purchases not placed on a creator code); creator rows and creatorTotal count from each creator's start date (countedFrom) and are never added into total. total includes purchases not linked to any campaign (the unattributed row); adLinkedTotal has the same spend but only campaign-linked payers and revenue, and is the figure to judge against the payback line. unattributedPayerOrigins splits the unattributed row's payers by the store of their first payment, their signup answer (selfReportedSource) and notFromChannels (channel ids whose own attribution, such as Apple AdServices answering attribution: false, said the person did not come from them, sent on any of the person's events; empty when unknown). Trials and first payments that only restore a store subscription already paid earlier (same originalTransactionId, or sent with restored: true) are not counted. Money in another currency is converted to the spend currency at the rates in fx (source live, fallback or env, with asOf); money with no known rate is left out of payback and listed in excludedRevenue, never counted as zero. paybackNullReason says why payback is null. keywords splits Apple Ads campaigns by keyword when revenue events carry the platform keyword id (keyword; keyword text from RevenueCat is placed on the campaign's one keyword with that text, and counts in unknown_keyword when several keywords share the text or the campaign's keyword list could not be read): keywords.campaigns[] has, per campaign (campaignKey = the campaign row key), keyword rows (kind keyword, keywordRef, text, matchType, taps, installs, trials, payers, revenue, payback) and one unknown_keyword row for people whose events never carried a keyword id or whose keyword text matched no single keyword (never moved onto a keyword). Each person sits in one row, so trials, payers and revenue of the keyword rows plus unknown_keyword add up to the campaign row; cost does not: keyword cost comes from Apple's keyword report for costFrom..costThrough (the campaign's first to last stored spend day, at most yesterday UTC), excludes Search Match, and is not guaranteed to sum to the campaign's cost. coverage gives the share of the campaign's payers and revenue that landed on keyword rows; when either is below 0.8 (lowCoverage), each keyword's payback is only a lower bound (paybackIsLowerBound). problem is set instead of rows when the keyword report could not be read. keywords.byText sums the same keyword text across campaigns (campaignKeys, keywordRefs); partial with excludedCampaignKeys lists Apple campaigns with spend whose keyword report was not read and so are missing from every total; the row with unreported true (text null) holds people and revenue on keyword ids that no report returned. keywords.measured is false when no event carries a keyword id; payers are then null, not zero. feed says when the workspace's own server last delivered revenue events (lastDeliveryAt, counting deliveries with no new event); counted is true when this ledger counts those events (not RevenueCat's); stale is true when counted and nothing has arrived for more than staleAfterHours (36), and the ledger then stops at lastDeliveryAt. feed is null when the server has never sent any or the delivery record could not be read. Money in (revenue) and payback are take-home: after store fees and refunds, so payback compares what the advertiser keeps with spend. Events sent before store fees (amountIsNet false) are reduced by the workspace's fee rate for their store, refunds by the same rate, before any currency conversion; amounts are shown rounded to the currency's smallest unit, payback is computed before rounding. Rows, totals, keyword rows and weeks carry takeHomeBasis (null when no event has an amount): takeHomeBasis.kind says where the take-home figure comes from: net_reported (sent after store fees), net_estimated (sent before fees, reduced by the workspace's store fee rate), net_mixed (both), gross or gross_mixed (not converted to take-home); takeHomeBasis.storeFees lists the rate used per store, isDefault true when it is Loop's default estimate (App Store 15%, Google Play 15%, Stripe 3.6%, other 0%) because the workspace set none (appProfile.storeFeeRates in PATCH /api/{workspace}/config). Taxes are not deducted, and the workspace's current rates are applied to past purchases too. storePage is the store's own product-page funnel the advertiser sends (POST /api/{workspace}/store-funnel), null when none was sent in the last 35 days (or it could not be read): not measured, never zero. windows has a 7-day and a 28-day window ending on lastReportedDate, the last day the store reported (whatever days is), each with daysReported, total and sources[] per platform and sourceType (search = App Store search, browse = App Store browse, app_referrer = another app such as Instagram or Facebook, web_referrer, other): impressions, pageViews, uniquePageViews (a sum of daily unique counts), firstDownloads, pageToDownloadRate (firstDownloads ÷ pageViews) and impressionToPageRate (pageViews ÷ impressions, search and browse only; null on total). Each rate is summed only over the days that reported both of its numbers; pageToDownloadDays and impressionToPageDays say how many, and pageToDownloadPartial / impressionToPagePartial are true when that is fewer than daysReported. A count the store did not report is null, not zero. Apple drops small cells, so every count is a lower bound and rates on low volumes are biased low. tooFewToJudge is true when the page views behind pageToDownloadRate are below minPageViews (30); such rates are shown but not judged. stale is true when lastReportedDate is more than 3 days before the ledger's end: the numbers are old (stale since lastReportedDate) and no rate is put on rows. In search and browse people can download from the results without opening the page, so pageToDownloadRate there, and on total, can be above 1.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_revenue_ledger"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Window in days ending today (UTC). Defaults to 28. |