Aquisição

Get Lead UTM

GET
/v1/acquisition/lead-utm

How many of the period's leads carry a real UTM and which channels bring the most. UTM coverage (coverage) counts only real UTM; channel origin (channels, tracked) is the real UTM or, when there is none, the CRM's channel attribution (HubSpot hs_analytics_source).

Rules:

  • Shares are fractions of totalLeads (0..1); with no lead in the period everything is 0 and channels is [].
  • mql is null (never 0) when no lead of the group was measured; see mqlUnavailableReason.
  • Organization grain: obt_lead_utm_daily is not cut by GTM motion. Without gtmMotionId or with the default motion, the organization's numbers; another motion of the organization is a 422 (GTM_MOTION_DATA_NOT_AVAILABLE); a motion of another organization is a 403.

Autorização

ClientIdAuthClientSecretAuth
headerx-client-id<token>

Client ID

headerx-client-secret<token>

Client secret

Parâmetros de query

organizationId*string

Identificador da organização (obrigatório). Um valor ausente ou que não seja string resulta em 400.

period?stringDescontinuado

Descontinuado: use startDate e endDate, que têm precedência quando enviados. Período relativo de N dias terminando hoje, inclusive (7d = hoje e os 6 dias anteriores). "Hoje" é o dia de calendário em UTC, e esse último dia ainda está parcial. Valores aceitos: 7d, 30d, 90d, 1y. Omitido ou vazio equivale a 30d; qualquer outro valor retorna 400.

Padrão"30d"
Valor em"7d""30d""90d""1y"
startDate?string

Início do período (YYYY-MM-DD, inclusivo). Envie junto com endDate: enviar só um dos dois retorna 400. Tem precedência sobre period. Use só a data: data com hora ou data inexistente retorna 400. Regras: startDate ≤ endDate, nenhuma data no futuro (UTC) e no máximo 365 dias entre as datas (até 366 dias no período). A comparação usa o período de mesma duração imediatamente anterior.

Formatodate
endDate?string

Fim do período (YYYY-MM-DD, inclusivo). Veja startDate para as regras. Quando o fim é hoje, esse último dia ainda está parcial, porque os dados do dia continuam chegando.

Formatodate
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.

Formatouuid

Corpo da resposta

Cobertura de UTM dos leads retornada com sucesso

application/json
  1. response

UTM coverage of the leads of the window (real UTM only) and the top channels by origin, real UTM or CRM channel attribution (V4MOS-3202). Source: analytics.obt_lead_utm_daily.

period*
coverage*
channels*array<>

Only leads with an origin (real UTM or the CRM's channel attribution), grouped by source/medium/campaign, most MQLs first (unmeasured last, leads break ties), top 10.

tracked*

Sum of the leads with a channel origin (real UTM or CRM channel attribution), not only those with a UTM.

mqlUnavailableReason*|

null when any lead with an origin (the same ones as tracked) has a measured mql; otherwise why the organization's CRM does not measure it.

Valor em"QUALIFICATION_NOT_MAPPED""CRM_NOT_SUPPORTED"null
curl -X GET "https://example.com/v1/acquisition/lead-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": {    "totalLeads": 100,    "complete": {      "leads": 60,      "share": 0.6    },    "noCampaign": {      "leads": 15,      "share": 0.15    },    "none": {      "leads": 25,      "share": 0.25    }  },  "channels": [    {      "source": "google",      "origin": "utm",      "medium": "cpc",      "campaign": "black-friday",      "leads": 40,      "measuredLeads": 40,      "mql": 10,      "leadToMql": 0.25    },    {      "source": "paid_social",      "origin": "crm_attribution",      "medium": null,      "campaign": null,      "leads": 20,      "measuredLeads": 20,      "mql": 4,      "leadToMql": 0.2    }  ],  "tracked": {    "leads": 75,    "measuredLeads": 75,    "mql": 18,    "leadToMql": 0.24  },  "mqlUnavailableReason": null}