CLI command
analytics unit-economics
Read CAC, payback and LTV to CAC per channel, each traceable to stored rows.
Invocation#
echo-cli analytics unit-economics <days>Inputs and output#
days is required and is any positive whole number. Per channel and currency the result names ad_spend (ad_campaign_metrics spend of the channel's ad_campaigns, in the currency each campaign's ad account declares), unmeasured_spend (each campaign day whose provider reported no spend), other_costs and other_cost_rows (every channel_costs row whose period overlaps the window, prorated to the overlapping days), spend, customers (distinct subjects ad_conversion_feedback_events attributes to the channel with positive net revenue: identity_key, else user_id, else anonymous_id), revenue (revenue less refunds), ltv (revenue per customer), cac, ltv_to_cac and payback_days (CAC over the window's daily revenue per customer). While any campaign day is unmeasured, ad_spend, spend, cac, ltv_to_cac and payback_days are null, because the spend is not known. A currency without customers answers null for ltv, cac, ltv_to_cac and payback_days. Amounts in different currencies are never added or converted. The equivalent MCP tool is echo_unit_economics.
State effect#
The command calls Echo Web's authenticated /api/analytics/unit-economics?days=<days> with ECHO_INTERNAL_BEARER at ECHO_WEB_BASE_URL, which reads ad_campaigns, ad_accounts, ad_campaign_metrics, channel_costs and ad_conversion_feedback_events and writes nothing; the Unit economics section of the dashboard's tracking screen and Echo Desktop's Revenue destination read the same operation.
Refusals#
- A window that is not a positive whole number, or more than one window, is refused with the usage status 2.
- Spend of a campaign ad_campaigns does not hold, a campaign whose ad account declares no currency, or a stored amount that is not a number ends the read with status 1 naming the row.