Acquisition

Get Order UTM

GET
/v1/acquisition/order-utm

How many of the period's paid orders carry a UTM and the result of the tracked ones by channel, with investment and ROAS.

Rules:

  • Only store platforms count (VTEX, Shopify, Tray, WooCommerce, Nuvemshop, Yampi).
  • Shares are fractions of totalOrders / totalRevenue (0..1); with no order in the period untrackedOrderShare is null and channels is [].
  • investment and roas are null (never 0), with investmentUnavailableReason.
  • GTM motion: like the sibling acquisition routes, a motion reads its own twin (obt_order_utm_daily_by_gtm_motion, and fct_media_daily_by_gtm_motion for the spend), that is, only the orders of the sales platforms of its connections. dbt keeps Yampi and Shopify apart (no dedupe, product decision of 2026-11-18), so the organization view adds both and the motion view is the way to pick the revenue. A motion of another organization is a 403.

Authorization

ClientIdAuthClientSecretAuth
headerx-client-id<token>

Client ID

headerx-client-secret<token>

Client secret

Query Parameters

organizationId*string

Organization identifier (required). A missing or non-string value is a 400.

period?stringDeprecated

Deprecated: use startDate and endDate, which take precedence when sent. Relative period of N days ending today, inclusive (7d = today and the 6 days before it). "Today" is the UTC calendar day, and that last day is still partial. Accepted values: 7d, 30d, 90d, 1y. Omitted or empty means 30d; any other value returns 400.

Default"30d"
Value in"7d""30d""90d""1y"
startDate?string

Start of the period (YYYY-MM-DD, inclusive). Send it together with endDate: sending only one of them returns 400. Takes precedence over period. Send the date only: a date with a time or a date that does not exist returns 400. Rules: startDate ≤ endDate, neither date in the future (UTC), and at most 365 days between the dates (up to 366 days in the period). The comparison uses the period of the same length right before it.

Formatdate
endDate?string

End of the period (YYYY-MM-DD, inclusive). See startDate for the rules. When the end date is today, that last day is still partial, because the day's data keeps arriving.

Formatdate
gtmMotionId?string

GTM motion of the organization (UUID, as gtm_motions.id), V4MOS-2707. Omitted, or the default motion of the organization: the organization numbers, exactly as before. Another motion of the organization: /v1/acquisition/paid-media answers with that motion's own rows (investment, impressions, clicks, CRM leads and CPL from analytics.obt_cpl_daily_by_gtm_motion; Meta/Google platform leads and Meta reach are null there); /v1/acquisition/summary, /v1/acquisition/channels and /v1/acquisition/unit-economics-over-time answer with that motion's own rows (V4MOS-2904): investment, new customers, LTV and cohorts from analytics.obt_acquisition_daily_by_gtm_motion, analytics.obt_acquisition_cohort_revenue_by_gtm_motion and analytics.obt_acquisition_customers_by_gtm_motion, the strategy of each campaign IN THE MOTION from analytics.dim_campaign_by_gtm_motion (the motion's own classification; a campaign it did not classify is unclassified, so CAC and payback price only the motion's acquisition campaigns), the coverage's investment by strategy from analytics.obt_strategy_investment_daily_by_gtm_motion (the dbt media fact, not the raw ad tables), and the motion's own contribution margin; /v1/acquisition/campaigns answers with the motion's campaigns: media rows from analytics.fct_media_daily_by_gtm_motion, customers, revenue and the CAC split from analytics.obt_acquisition_daily_by_gtm_motion with the motion's classification (analytics.dim_campaign_by_gtm_motion), payback from analytics.obt_acquisition_cohort_revenue_by_gtm_motion, CRM leads and MQLs from analytics.obt_cpl_daily_by_gtm_motion, the motion's contribution margin, and the Meta/Google platform leads and Meta Qualification events selected by the motion's own win-flow config, read from the raw platform tables restricted to the accounts and listed campaigns of the connections that config names; /v1/acquisition/paid-media/audience reads facebook_ads_demographic / facebook_ads_region restricted to the Meta accounts of the motion's connections and, for a connection taken by a list of campaigns, to the ad sets of those campaigns (hasMeta: false for a motion without Meta); /v1/acquisition/new-customers-over-time reads the motion's new customers from analytics.obt_acquisition_daily_by_gtm_motion; /v1/acquisition/funnel answers the funnel of the motion's own win-flow config. A route whose *_by_gtm_motion model is not published in the environment yet answers 422 GTM_MOTION_DATA_NOT_AVAILABLE for another motion (the dbt models and the API deploy independently). Not a UUID: 400. Not a live motion of the organization: 403 GTM_MOTION_NOT_IN_ORGANIZATION.

Formatuuid

Response Body

Cobertura de UTM dos pedidos retornada com sucesso

application/json
  1. response

UTM coverage of the paid orders of the window and the result of the tracked ones per channel (V4MOS-3185). Source: analytics.obt_order_utm_daily (orders and revenue) and analytics.fct_media_daily (investment per channel).

period*
coverage*
untrackedOrderShare*|

Fraction of the paid orders with no UTM (coverage.none.orders ÷ totalOrders, 0..1). null, never 0, when the window has no order. The warning of the Decisão tab starts at 10%.

channels*array<>

Only tracked orders (band complete or no_campaign). A paid channel is one row (its spend is per channel); the organic origins are one row per utm_source / utm_medium. Most orders first, top 10.

tracked*

Sum of the tracked orders.

curl -X GET "https://example.com/v1/acquisition/order-utm?organizationId=c0ad4763-173e-4a05-9cff-5208c8ea5f6a&period=30d&startDate=2026-03-11&endDate=2026-03-22&gtmMotionId=019a5b2e-7c4d-7abc-8def-0123456789ab"
{  "period": {    "start": "2026-11-01",    "end": "2026-11-27"  },  "coverage": {    "totalOrders": 100,    "totalRevenue": 15000,    "complete": {      "orders": 50,      "revenue": 9000,      "orderShare": 0.5,      "revenueShare": 0.6    },    "noCampaign": {      "orders": 10,      "revenue": 1500,      "orderShare": 0.1,      "revenueShare": 0.1    },    "none": {      "orders": 40,      "revenue": 4500,      "orderShare": 0.4,      "revenueShare": 0.3    }  },  "untrackedOrderShare": 0.4,  "channels": [    {      "channel": "Meta Ads",      "source": "meta",      "medium": "cpc",      "orders": 40,      "revenue": 7000,      "investment": 3000,      "roas": 2.33,      "investmentUnavailableReason": null    },    {      "channel": "Orgânico",      "source": "google",      "medium": "organic",      "orders": 20,      "revenue": 3500,      "investment": null,      "roas": null,      "investmentUnavailableReason": "organic_channel"    }  ],  "tracked": {    "orders": 60,    "revenue": 10500,    "investment": 3000,    "roas": 2.33  }}