get_revenue_diagnosis
Read the revenue ledger as verdicts: for each path, whether it pays back (at least 1.1× on take-home money in), is below the line, is below even at its upper bound, could cross the line depending on money in excluded for lack of an exchange rate (unconverted_currency, see excludedRevenue), or is unmeasured; where it is stuck (the ad, the store page, or the purchase); and how far the network's own report is from the advertiser's revenue. creatorSignupCost counts from each creator's start date and gives each creator code's cost per signup (paid, and with planned payments) and the total, judged against the workspace's line; with fewer signups than minSignups the verdict is not_enough_signups rather than a guess. stagedTestGuard (null when the workspace has no staged ad test) judges the test's stop lines every day from its first day, on ad spend per trial: totals.trialCostJpy is totals.judgedSpendJpy divided by totals.trials (production trial starts tied to a test campaign on a planned platform, by name or by the platform's id, each user once; null when there are none), both counted through judgedThrough, the last day every platform delivering the test has sent its spend rows (a platform whose test campaigns are all stopped is not waited for). It is read from day plan.trialCostFromDay against plan.trialStopAboveJpy and plan.trialScaleAtOrBelowJpy, comparing the unrounded figure. holdReasons (spend_rows_missing, spend_not_in_jpy, trials_without_spend) say why neither cost line is read yet; notes (trial_sources_mixed, channel_not_awaited) do not change the verdict. Verdicts: stop (with reasons: daily_cap, month_total, cost_per_trial above the stop line or no trials once spend passes it, day2_zero_trials), hold, eligible_to_scale (ad spend per trial at or below the scale line after plan.minDays; Loop does not raise the budget), not_started or not_enough_data. judgedOn says which figure the verdict used. totals.costPerPayerJpy (spend per added paid subscriber) is shown beside it against plan.scaleAtOrBelowJpy and plan.stopAboveJpy, and decides the verdict (stop reason cost_per_payer) only when trials are not tied to campaigns (adTrialsMeasured false). Its campaigns are the ones whose names start with the plan's campaignNamePrefixes. On stop, stopProposal says what the periodic cycle does: pause_proposed (one pause proposal per running test campaign, waiting for a person to approve), or no proposal: outside_test_window (the reasons in proposalReasons are only acted on through the last test day, month_total through its month), no_matching_campaign or already_paused. Spend lines count only the test campaigns' spend; the daily_cap line applies through the shortest test length. creatorSignupQuestion (null when the workspace has no such question) answers its dated question from the creator subtotal (creatorTotal, paid plus planned yen ÷ signups): at_or_below_line, up_to_ceiling or above_ceiling, or, with no figure made up, no_cost, no_signups, signups_not_counted, cost_not_in_jpy or no_creators; thin is true below minSignups. keywords judges Apple Ads keywords with the same verdicts: scope campaign (one keyword in one campaign, campaignKey and keywordRef) and scope all_campaigns (the same keyword text summed across two or more campaigns). thin is true below 3 payers, and such a payback is not a verdict to act on. With lowCoverage the payback is a lower bound: the verdict is pays_back only if even the lower bound clears the line, otherwise unmeasured. A partial all_campaigns row (excludedCampaignKeys) is always unmeasured. A keyword to review is verdict below_line with thin false. splitVerdict is true when a campaign's own verdict and the all-campaign verdict are both settled (pays_back or below_line, not thin, not maturing) and on opposite sides of the line. trend gives the last 8 weeks whatever days is, and is there even when the days window has no purchase (null only when none of those weeks has a purchase event): weeks lists each week's from and through, 7 UTC days ending today or a multiple of 7 days before, oldest first, so the newest week is the 7-day window. trend.total (ad platforms and unattributed purchases), trend.creatorTotal and each of trend.rows (kind, key, channel as in rows) have one entry per week with cost, revenue, trials, openTrials, payers, payback and the same fields as the ledger. A person counts as a payer once, in the week of their earliest first payment; a later first_payment of the same person adds money in but no payer. When a channel with linked money in that week has no confirmed spend through the week's end, its rows and trend.total have payback null, paybackNullReason spend_not_covered and the channel in spendNotCovered (missing spend is not read as zero). A creator week counts what was paid and what came in that week (not from the creator's start); a payment made before the creator started sits in the week it was paid, and weeks before the start with no payment are null. thin is true below 3 payers and that week's payback is not to be read, except a week with spend, no payers and no money in, which is a settled 0. maturing is true when at least half of the week's trials started in the last 7 days and have no outcome yet. 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. On a row whose bottleneck is store, rows[].storePage gives the measured page → download rate for the source that path arrives from (Meta: app_referrer, Apple Ads: search; iOS), from the 7-day window when days is 7 or less and the 28-day window otherwise, with pageToDownloadDays, pageToDownloadPartial and tooFewToJudge. scope source_type means it is the rate of all store traffic of that source, not the campaign's own (an Apple Ads campaign is only part of search, and Meta clicks also include Android), so it is context, not a verdict on the path. rows[].storePage is null on other rows, paths without a matching source, and when storePage is stale. 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. Loop does not change the ads from these verdicts without an approval, and never raises a budget from them.
get_revenue_ledger
Score 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.