read
analytics

Compare aggregate performance between two adjacent time windows. Returns revenue, orders, spend, ROAS, and conversion-ra

Changed on

Compare aggregate performance between two adjacent time windows. Returns revenue, orders, spend, ROAS, and conversion-rate totals for the current period and the prior period of equal length, plus deltas. Spend is the whole ad bill (every platform and campaign, shop currency); when spend_withheld is true some spend has no amount or the bill has not reported the period yet: ROAS is null and spend_note says why. Window options: "week" (the last 7 complete days, through yesterday UTC, vs the 7 before), "month" (30 vs 30), "custom" (caller supplies days); from/to are inclusive and today's part-day is in neither period. ROAS divides revenue by spend of the same days: when the ad bill has not reported a period's last days yet, roas_from/roas_to name the days it covers, the spend delta compares per-day spend over those days and roas_note says so. Each period reports days_with_data; when the current period holds fewer data days than the prior (a sync that has not landed yet), the deltas compare per-day averages and comparison_note explains it.

post/api/v1/tools/compare_periods

Request

  • Base URL
    https://app.magistry.io
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://app.magistry.io/api/oauth/authorize
      Token URLhttps://app.magistry.io/api/oauth/token
      Scopesanalytics:read

Request body

object required
window, 'week' | 'month' | 'custom'

Length of each comparison period. Default: week.

days, integer

Period length in days when window === "custom".

Response

Tool result

object required
ok, boolean required
result, unknown required

Changes

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    • warning

      added the new method_not_allowed enum value to the error response property for the response status

    11 more changes in this revision