Run an attribution query by UTM source, campaign, or ad
See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.
Required scope:analytics:readThis is the endpoint behind the Attribution board.
Use it to count new customers per Meta ad set, rank campaigns by attributed revenue
against their spend, or export credit by UTM source on a schedule.
How attribution works explains how credit is
assigned.
dimension decides what each row is. Each row also carries the platform IDs for its
grain when the click had them.
dimension
One row per
ID columns on the row
utm_source
Traffic source (Meta Ads, Google Ads, Klaviyo, Direct / (not set))
mktAccountId
utm_medium
Source and medium
mktAccountId
utm_campaign
Campaign
mktAccountId, mktCampaignId
utm_source_campaign
Source and campaign
mktAccountId
utm_adset
Ad set
mktAccountId, mktAdsetId
utm_term
Ad set, keyed on the utm_term value
mktAccountId, mktAdsetId
utm_ad
Ad
mktAccountId, mktAdId
utm_content
Ad, keyed on the utm_content value
mktAccountId, mktAdId
Names come from your connected ad platform when the click’s IDs match its data,
otherwise from the UTM value on the click. A campaign with no matching platform data
shows its raw ID or UTM value as the name. Rows with no value show (not set).
The schema accepts other dimension values, but they return source-level rows, so
stick to these eight.
first_click credits the earliest touchpoint in the window, and last_click the
latest. Visits with no detectable source only win when the customer has no other
visit in the window.
any_click credits every source the customer clicked, so rows add up to more than
the total. Don’t sum them.
attributionWindow is how many days before the order (or the conversion event, with
valueSource: events) to look for touchpoints. -1 means no limit.
To filter by campaign ID, put the ID in attribution.utm_campaign. The channel.*
fields, such as channel.campaign_id, belong to the ad-listing endpoints and return
500 here. A value matches every row whose name or ID equals it, across sources, so
add an attribution.utm_source condition when the same name appears in more than one
channel.
The attribution.* fields only support exact matches today. Use equals, or in
for a list. Other operators that List filter fields
lists for these fields, such as not_equals or contains, are accepted but run as
exact matches: not_equals "Meta Ads" returns only Meta Ads.
attribution.utm_medium conditions are ignored, and so are attribution.*
conditions inside a not group or inside an and that is nested in an or.
Put conditions at the top level of an and, or in one or group under it.
orders.* conditions support their full operator set, but only with
valueSource: orders. With valueSource: events they’re ignored.
The web app applies your saved order settings
(pending and voided orders, refund dating, exclusion filters) to attribution. This
endpoint only uses the orderSettings you send. Without them, pending and voided
orders count and nothing is excluded. To match the board, read them with
Get order settings and pass the returned
object as orderSettings. Order settings only apply with valueSource: orders.
results has one entry with dateRange, dimension, the filter you sent,
data.primary, and measureDetails.
data.primary holds one row per dimension value, sorted by orders.count (or
core.conversions with valueSource: events), highest first. row_number gives
the position.
Each row carries every measure for the value source, keyed by measure id.
valueSource: orders returns orders.* measures (orders, new customers, revenue,
margins). valueSource: events returns core.conversions,
core.unique_converters, core.conversion_value, core.average_conversion_value,
core.cpa, and core.roas. Both add channel.* spend and click measures and
tracked.* visitor counts. measureDetails[].measure lists every measure id the
rows carry, with its total.
Values come back as numeric strings (for example "66930.1000"). A value of zero
comes back as null. Parse both before doing math.
Each row carries utm_source, the column named by dimension, and the ID columns
in the table above. utm_adset and utm_ad appear on every row, but only hold
the row’s own ad set or ad at those two grains, so ignore them elsewhere.
A malformed filters tree returns 400 with the reason in errors.
A filter field this endpoint doesn’t accept, an unknown field, or an operator the
field doesn’t list returns 500 with the reason in message, for example
Filter field "channel.campaign_id" is not valid for context "attribution".
When the query itself fails, the response is 200 with an empty body and no
results. Treat that as “no answer”, not “no conversions”.
Ad set and ad breakdowns over long ranges can time out with 502. Shorten the date
range and retry.
Without timezone, dates are read as UTC days. dateRange.end is inclusive.
currency is case-insensitive. A code that isn’t three letters falls back to USD
without an error. See Reporting currency.
pixelId in the body must equal the x-pixel-id header, or the request returns 403.
Narrow the rows with attribution.utm_* fields (exact match on name or
platform ID) and orders.* fields. Only equals and in behave as
written on attribution.* fields.
ISO 4217 code to convert money measures to (e.g. EUR). Each
amount converts at the rate for the day it occurred.
Defaults to USD when omitted, so if your store sells in
another currency, pass this explicitly.
What counts as a conversion. orders uses store orders and returns orders.*
measures. events uses the tracked event named in conversionEvent and
returns core.* conversion measures.
Order settings to apply to this query. The query endpoints don't read the account's
saved order settings, so pass them here to match the web app's numbers. The
orderSettings object returned by Get order settings
can be passed as-is.
Show child attributes
Response
Attribution results.
results is absent when the attribution query couldn't be run — the response is
then an empty object with a 200. Treat a missing results as "no answer", not
as "no conversions": an empty results array is the real no-data case.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Upstack Data","colors":{"primary":"#4230b4","light":"#6366F1","dark":"#322484"},"logo":{"light":"https://mintcdn.com/upstackdata-afbed50d/40dgTTn1PLjePhJa/logo/light.svg?fit=max\u0026auto=format\u0026n=40dgTTn1PLjePhJa\u0026q=85\u0026s=598c05fb87860ddc1b6b7640b41e136c","dark":"https://mintcdn.com/upstackdata-afbed50d/40dgTTn1PLjePhJa/logo/dark.svg?fit=max\u0026auto=format\u0026n=40dgTTn1PLjePhJa\u0026q=85\u0026s=4ffdf28479b596176b69034675d783b0","href":"https://docs.upstackdata.com/get-started/overview"},"favicon":"https://mintcdn.com/upstackdata-afbed50d/a7q81tQDxtvowAUn/favicon.svg?fit=max\u0026auto=format\u0026n=a7q81tQDxtvowAUn\u0026q=85\u0026s=4e6cad1d3845d8fe1e1f8fb54b430a3f","appearance":{"default":"light","strict":true},"navbar":{"links":[{"href":"https://docs.upstackdata.com/troubleshooting/support","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.upstackdata.com"}},"footer":{"socials":{"x":"https://x.com/upstackdata","linkedin":"https://linkedin.com/company/upstackdata"},"links":[{"header":"Product","items":[{"label":"Website","href":"https://www.upstackdata.com"},{"label":"Pricing","href":"https://www.upstackdata.com/pricing"},{"label":"Dashboard","href":"https://app.upstackdata.com"}]},{"header":"Resources","items":[{"label":"Documentation","href":"https://docs.upstackdata.com/get-started/overview"},{"label":"All troubleshooting guides","href":"https://docs.upstackdata.com/troubleshooting/overview"},{"label":"Blog","href":"https://www.upstackdata.com/blog"}]},{"header":"Support","items":[{"label":"Contact Support","href":"https://docs.upstackdata.com/troubleshooting/support"},{"label":"Install on Shopify","href":"https://docs.upstackdata.com/quickstart/install-on-shopify"},{"label":"Troubleshooting","href":"https://docs.upstackdata.com/troubleshooting/overview"}]},{"header":"Legal","items":[{"label":"Terms of Service","href":"https://www.upstackdata.com/terms"}]}]},"seo":{},"fonts":{"family":"Inter"},"integrations":{"intercom":{"appId":"y2qnvi2j"}},"contextual":{"options":["copy","view","claude"],"display":"header"},"metadata":{"timestamp":false},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"upstackdata-afbed50d","hasAudioNarration":false,"actualSubdomain":"upstackdata-afbed50d","customDomains":["docs.upstackdata.com"],"gitSource":{"type":"github","owner":"upstack-data","repo":"upstack-doc-site","deployBranch":"release/dev2","isPrivate":true,"contentDirectory":"","mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af205e1130c63682a17c260","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"Metrics","count":803},{"language":"default","tag":"METRICS","count":803},{"language":"default","tag":"Orders","count":271},{"language":"default","tag":"Advertising","count":268},{"language":"default","tag":"Funnel","count":246},{"language":"default","tag":"Documentation","count":175},{"language":"default","tag":"Conversions","count":149},{"language":"default","tag":"Blended","count":110},{"language":"default","tag":"OVERVIEW","count":107},{"language":"default","tag":"Event Tracking","count":104}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@upstackdata.com","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx3cwhsk.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxTcwhsk.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxPcwhsk.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx_cwhsk.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx7cwhsk.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx3cwhsk.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxTcwhsk.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxPcwhsk.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx_cwhsk.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx7cwhsk.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPxDcwg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n:root{--font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;--font-size-label: 0.6875rem;--font-size-tiny: 0.75rem;--font-size-small: 0.8125rem;--font-size-secondary: 0.875rem;--font-size-body: 0.9375rem;--font-size-h3: 1.0625rem;--font-size-h2: 1.25rem;--font-size-h1: 1.625rem;--font-size-code: 0.8125rem;--page-bg: #ffffff;--chrome-bg: #f6f7f8;--border: #e5e7eb;--accent: #4230b4;--accent-hover: #322484;--text-heading: #18181b;--text-body: #52525b;--text-muted: #71717a;--focus-ring: rgba(24, 24, 27, 0.12);--border-strong: #d4d4d8;--input-bg: #ffffff;--hover-bg: rgba(24, 24, 27, 0.04);--active-bg: rgba(24, 24, 27, 0.06)}html{background:var(--page-bg);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{background:var(--page-bg);color:var(--text-body);font-family:var(--font-sans)!important;font-size:var(--font-size-body)!important;line-height:1.6!important;font-weight:400!important}#navbar,#header{background:var(--chrome-bg)!important;border-bottom:1px solid var(--border)!important;backdrop-filter:none!important}.nav-tabs-item{font-size:var(--font-size-small)!important;font-weight:400!important;color:var(--text-muted)!important}.nav-tabs-item[data-active],.nav-tabs-item:hover{color:var(--text-heading)!important}#sidebar,#sidebar-content{background:var(--chrome-bg)!important;border-right:1px solid var(--border)!important}#sidebar{top:calc(7.1rem + var(--banner-height, 0px))!important;height:auto!important}#sidebar-content{overscroll-behavior:contain}.sidebar-group-header,.sidebar-title{font-size:var(--font-size-label)!important;font-weight:600!important;letter-spacing:0.05em;text-transform:uppercase;color:var(--text-muted)!important;margin-top:24px!important;margin-bottom:8px!important;padding-top:0!important;padding-bottom:0!important}#sidebar-content>div:first-child .sidebar-group-header,#sidebar-content>div:first-child .sidebar-title{margin-top:12px!important}#sidebar-content ul{padding-left:12px!important}#sidebar-content ul ul{padding-left:14px!important;border-left:1px solid var(--border)!important;margin-left:4px!important}.sidebar-group a,#sidebar a{font-size:var(--font-size-small)!important;font-weight:400!important;color:var(--text-body)!important;padding-top:5px!important;padding-bottom:5px!important;line-height:1.4!important;transition:color 80ms ease}.sidebar-group a:hover,#sidebar a:hover{color:var(--text-heading)!important}#navigation-items a,#navigation-items button,#sidebar-content .sidebar-group>button,#sidebar-content .sidebar-group button{border-radius:4px!important;transition:color 80ms ease, background-color 80ms ease!important}#navigation-items a:hover,#navigation-items button:hover{background:var(--hover-bg)!important}#navigation-items a[class*=\"bg-primary\"]{background:var(--active-bg)!important;color:var(--accent)!important;font-weight:500!important}.sidebar-group>button,.sidebar-group button{font-size:var(--font-size-small)!important;font-weight:400!important;color:var(--text-body)!important;padding-top:5px!important;padding-bottom:5px!important;transition:color 80ms ease}.sidebar-group>button:hover,.sidebar-group button:hover{color:var(--text-heading)!important}.eyebrow,.breadcrumb-list,.breadcrumb-item{font-size:var(--font-size-label)!important;color:var(--text-muted)!important;font-weight:500!important;text-transform:uppercase!important;letter-spacing:0.05em!important}div[class*=\"peer-[.is-not-custom]\"]{max-width:none!important}#content-area,#content,#content-container,#content-side-layout{background:var(--page-bg)!important;max-width:none!important}#navbar div[class*=\"max-w-8xl\"]{max-width:none!important}#table-of-contents-layout{max-width:none!important}#body-content{max-width:none!important}.mdx-content{max-width:none!important;overflow-wrap:break-word}h1,h2,h3,h4,h5,h6,#page-title,.mdx-content h1,.mdx-content h2,.mdx-content h3,.mdx-content h4,.mdx-content h5,.mdx-content h6{font-family:var(--font-sans)!important;text-wrap:balance}#page-title,.mdx-content h1{color:var(--text-heading)!important;font-size:var(--font-size-h1)!important;font-weight:600!important;line-height:1.2!important;letter-spacing:-0.01em;margin-top:0!important;margin-bottom:2px!important}.mdx-content>h2,.mdx-content>div>h2{color:var(--text-heading)!important;font-size:var(--font-size-h2)!important;font-weight:600!important;line-height:1.3!important;letter-spacing:-0.01em;margin-top:32px!important;margin-bottom:12px!important}.mdx-content>h3,.mdx-content>div>h3{color:var(--text-heading)!important;font-size:var(--font-size-h3)!important;font-weight:600!important;line-height:1.4!important;margin-top:24px!important;margin-bottom:8px!important}.mdx-content>h4,.mdx-content>div>h4{color:var(--text-heading)!important;font-size:var(--font-size-body)!important;font-weight:600!important;line-height:1.45!important;margin-top:20px!important;margin-bottom:6px!important}.mdx-content p,.mdx-content [data-as=\"p\"],.mdx-content li{color:var(--text-body)!important;font-size:var(--font-size-body)!important;line-height:1.6!important;font-weight:400!important}.mdx-content p{text-wrap:pretty}.mdx-content>p:first-of-type,.mdx-content>[data-as=\"p\"]:first-of-type{color:var(--text-body)!important;font-size:var(--font-size-body)!important;font-weight:400!important;line-height:1.6!important;margin-top:0!important;margin-bottom:20px!important}.mdx-content a,.mdx-content .link{color:var(--accent)!important;text-decoration:none;transition:color 80ms ease}.mdx-content a:hover,.mdx-content .link:hover{color:var(--accent-hover)!important;text-decoration:underline}.mdx-content a.link:has(>div){background:var(--page-bg)!important;border:1px solid var(--border)!important;border-radius:4px!important;box-shadow:none!important;padding:16px 18px!important;transition:border-color 80ms ease, background-color 80ms ease!important}.mdx-content a.link:has(>div):hover{border-color:var(--border-strong)!important;background:var(--page-bg)!important;box-shadow:none!important;transform:none!important;text-decoration:none!important}.mdx-content a.link:has(>div)>div:first-child{color:var(--accent)!important;font-size:var(--font-size-secondary)!important;font-weight:500!important;line-height:1.35!important;margin:0 0 4px 0!important;padding:0!important}.mdx-content a.link:has(>div)>div:last-child{color:var(--text-muted)!important;font-size:var(--font-size-small)!important;font-weight:400!important;line-height:1.4!important;margin:0!important;padding:0!important}.card-group,.columns{gap:12px!important}#topbar-cta-button{background:var(--accent)!important;border:1px solid var(--accent)!important;color:#fff!important;border-radius:4px!important;font-family:var(--font-sans)!important;font-size:var(--font-size-small)!important;font-weight:500!important;padding:6px 12px!important;box-shadow:none!important}#topbar-cta-button:hover{background:var(--accent-hover)!important;border-color:var(--accent-hover)!important}#page-context-menu button{border-radius:4px!important;border-color:var(--border)!important}#feedback-thumbs-up,#feedback-thumbs-down{border-radius:4px!important;border-color:var(--border)!important;background:var(--page-bg)!important}[data-assistant-bar] div[class*=\"rounded-2xl\"]{border-radius:4px!important;border-color:var(--border)!important}#search-input,#search-bar-entry{border:1px solid var(--border)!important;border-radius:4px!important;font-family:var(--font-sans)!important;font-size:var(--font-size-small)!important;background:var(--input-bg)!important;color:var(--text-body)!important}#search-input:focus{border-color:var(--border-strong)!important;box-shadow:0 0 0 3px var(--focus-ring)!important;outline:none!important}#search-input kbd,#search-bar-entry kbd{font-family:var(--font-mono)!important;font-size:var(--font-size-label)!important}#topbar-cta-button:focus-visible,#page-context-menu button:focus-visible,#navigation-items a:focus-visible,#navigation-items button:focus-visible,.toc-item a:focus-visible,#pagination a:focus-visible,#footer a:focus-visible{outline:2px solid var(--text-muted)!important;outline-offset:2px}.mdx-content table{border:1px solid var(--border)!important;border-collapse:collapse!important;font-variant-numeric:tabular-nums}.mdx-content th{background:var(--chrome-bg)!important;font-size:var(--font-size-small)!important;font-weight:600!important;color:var(--text-heading)!important;padding:8px 12px!important}.mdx-content td{border-color:var(--border)!important;font-size:var(--font-size-secondary)!important;padding:8px 12px!important}.mdx-content pre{border-radius:4px!important}code,pre,pre code,.code-block,[class*=\"language-\"]{font-family:var(--font-mono)!important}pre,.code-block{font-size:var(--font-size-code)!important;line-height:1.6!important}code{border-radius:4px!important;font-size:var(--font-size-code)!important;background:var(--chrome-bg)!important;color:var(--text-heading)!important;padding:1px 4px!important;border:1px solid var(--border)!important}pre code{background:transparent!important;border:0!important;padding:0!important;font-size:inherit!important}.mdx-content+.prose,[class*=\"text-lg\"][class*=\"prose\"]{font-size:var(--font-size-body)!important;line-height:1.6!important;color:var(--text-body)!important}.accordion{border:1px solid var(--border)!important;border-radius:4px!important;overflow:hidden}.accordion-group{border:1px solid var(--border)!important;border-radius:4px!important}.accordion-group>.accordion{border-radius:0!important;border-left:0!important;border-right:0!important;border-top:0!important}.accordion-group>.accordion:last-child{border-bottom:0!important}.mdx-content [data-component-part=\"accordion-title\"]{color:var(--text-heading)!important;font-size:var(--font-size-body)!important;font-weight:500!important}[data-component-part=\"accordion-content\"]{font-size:var(--font-size-body)!important;line-height:1.6!important;color:var(--text-body)!important}[data-component-part=\"accordion-content\"] p,[data-component-part=\"accordion-content\"] [data-as=\"p\"],[data-component-part=\"accordion-content\"] li{font-size:var(--font-size-body)!important;line-height:1.6!important;color:var(--text-body)!important;font-weight:400!important}.steps{margin-top:24px!important}.step{padding-bottom:24px!important}.mdx-content [data-component-part=\"step-title\"]{font-size:var(--font-size-h3)!important;font-weight:600!important;line-height:1.4!important;color:var(--text-heading)!important;margin-top:0!important;margin-bottom:8px!important}.mdx-content [data-component-part=\"step-title\"] a{color:inherit!important;text-decoration:none!important}.mdx-content [data-component-part=\"step-title\"]:hover a{color:var(--accent)!important}[data-component-part=\"step-number\"]{color:var(--text-muted)!important}[data-component-part=\"step-line\"]{background-color:var(--border)!important}[data-component-part=\"step-content\"]{font-size:var(--font-size-body)!important;line-height:1.6!important;color:var(--text-body)!important}[data-component-part=\"step-content\"] p,[data-component-part=\"step-content\"] [data-as=\"p\"],[data-component-part=\"step-content\"] li{font-size:var(--font-size-body)!important;line-height:1.6!important;color:var(--text-body)!important;font-weight:400!important}[data-component-part=\"step-content\"] a{color:var(--accent)!important;text-decoration:none!important;transition:color 80ms ease}[data-component-part=\"step-content\"] a:hover{color:var(--accent-hover)!important;text-decoration:underline!important}.callout{border-radius:4px!important}[data-component-part=\"callout-content\"]{font-size:var(--font-size-secondary)!important;line-height:1.6!important}[data-component-part=\"callout-content\"] p,[data-component-part=\"callout-content\"] [data-as=\"p\"]{font-size:var(--font-size-secondary)!important;line-height:1.6!important}.mdx-content strong,[data-component-part=\"accordion-content\"] strong{color:var(--text-heading)!important;font-weight:600!important}.mdx-content em,[data-component-part=\"accordion-content\"] em{font-style:italic}.mdx-content blockquote{border-left:3px solid var(--border)!important;padding-left:16px!important;color:var(--text-muted)!important}.toc{font-size:var(--font-size-small)!important}.toc-item a{color:var(--text-muted)!important;transition:color 80ms ease}.toc-item a:hover{color:var(--text-heading)!important}.toc-item[data-active]>a,.toc-item[data-active-deepest]>a{color:var(--accent)!important}#pagination{font-size:var(--font-size-small)!important;color:var(--text-body)!important;border-top:1px solid var(--border)!important;padding-top:16px!important;margin-top:32px!important}#pagination a{color:var(--text-body)!important;transition:color 80ms ease}#pagination a:hover{color:var(--accent)!important}hr{border-color:var(--border)!important}#footer,footer{background:transparent!important;border-top:1px solid var(--border)!important;color:var(--text-muted)!important;margin-top:48px!important;font-size:var(--font-size-small)!important}#footer:not(.advanced-footer),footer:not(.advanced-footer){padding-top:24px!important;padding-bottom:32px!important}#footer.advanced-footer{padding:0!important}#footer.advanced-footer>div{padding-top:32px!important;padding-bottom:32px!important}@media (min-width: 768px){#footer.advanced-footer>div{padding-top:40px!important;padding-bottom:40px!important}}#footer.advanced-footer p{color:var(--text-heading)!important;font-size:var(--font-size-small)!important;font-weight:600!important;margin-bottom:4px!important}#footer.advanced-footer a{color:var(--text-muted)!important;font-size:var(--font-size-small)!important;transition:color 80ms ease}#footer.advanced-footer a:hover{color:var(--text-heading)!important}#footer a{color:var(--text-muted)!important;transition:color 80ms ease}#footer a:hover{color:var(--text-heading)!important}#footer svg{background-color:var(--text-muted)!important;transition:background-color 80ms ease}#footer a:hover svg{background-color:var(--accent)!important}[data-testid=\"sales-agent-background\"]{background:var(--accent)!important}[data-testid=\"sales-agent-background\"]>div{background:transparent!important;opacity:0!important}.intercom-launcher-frame,.intercom-lightweight-app-launcher,.intercom-messenger-frame,[class^=\"intercom-\"][class*=\"frame\"]{border-radius:12px!important;box-shadow:0 8px 24px rgba(26, 31, 54, 0.12), 0 2px 6px rgba(26, 31, 54, 0.06)!important}.intercom-launcher-frame,.intercom-lightweight-app-launcher{background:var(--accent)!important}::selection{background:var(--accent)!important;color:#fff!important}*{scrollbar-color:var(--border-strong) transparent}*::-webkit-scrollbar{width:10px;height:10px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:5px;border:2px solid var(--page-bg)}*::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}@media (max-width: 1024px){#content-area,#content,#content-container{padding-left:16px!important;padding-right:16px!important}#table-of-contents,#table-of-contents-layout aside{display:none!important}.card-group,.columns{grid-template-columns:1fr!important;gap:10px!important}}@media (max-width: 768px){:root{--font-size-h1: 1.375rem;--font-size-h2: 1.125rem;--font-size-h3: 1rem;--font-size-body: 0.875rem;--font-size-code: 0.75rem}.mdx-content>h2,.mdx-content>div>h2{margin-top:24px!important}.mdx-content>h3,.mdx-content>div>h3{margin-top:16px!important}#content-area,#content,#content-container{padding-left:12px!important;padding-right:12px!important}.mdx-content a.link:has(>div){padding:12px 14px!important}.mdx-content a.link:has(>div)>div:first-child{font-size:var(--font-size-small)!important}.mdx-content a.link:has(>div)>div:last-child{font-size:var(--font-size-tiny)!important}.mdx-content table{display:block!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;max-width:100%!important}.mdx-content th,.mdx-content td{font-size:var(--font-size-tiny)!important;padding:6px 8px!important;white-space:nowrap}pre,.code-block{overflow-x:auto!important;-webkit-overflow-scrolling:touch;max-width:100%!important}[data-component-part=\"callout-content\"],[data-component-part=\"callout-content\"] p,[data-component-part=\"callout-content\"] [data-as=\"p\"]{font-size:var(--font-size-small)!important}#sidebar,#sidebar-content{width:280px!important}#navbar,#header{padding-left:12px!important;padding-right:12px!important}#topbar-cta-button{font-size:var(--font-size-tiny)!important;padding:5px 10px!important}#pagination{flex-direction:column!important;gap:8px!important}}@media (max-width: 480px){:root{--font-size-h1: 1.25rem;--font-size-h2: 1rem;--font-size-h3: 0.9375rem}#content-area,#content,#content-container{padding-left:12px!important;padding-right:12px!important}#search-input+kbd,#search-bar-entry kbd{display:none!important}}.catalog-page .card{border:1px solid var(--border)!important;border-radius:4px!important;box-shadow:none!important;margin:0 0 6px 0!important;transition:border-color 80ms ease}.catalog-page .card:hover{border-color:var(--border-strong)!important;background:var(--page-bg)!important}.catalog-page .card>div{display:flex!important;align-items:center!important;gap:12px!important;padding:9px 16px!important}.catalog-page .card [data-component-part=\"card-icon\"],.catalog-page .card [data-component-part=\"card-icon\"] svg{width:18px!important;height:18px!important;flex-shrink:0;color:var(--accent)!important;fill:var(--accent)!important}.catalog-page .card .w-full{flex:1!important;min-width:0}.catalog-page .card [data-component-part=\"card-title\"]{display:inline!important;font-size:14px!important;font-weight:500!important;color:var(--text-heading)!important;margin:0 10px 0 0!important;line-height:1.4!important}.catalog-page .card [data-component-part=\"card-content\"]{display:inline!important;font-size:13px!important;color:var(--text-muted)!important;line-height:1.45!important}.catalog-page h3{font-size:13px!important;font-weight:600!important;color:var(--text-muted)!important;text-transform:uppercase;letter-spacing:0.04em;margin:22px 0 10px!important}.catalog-page .card>div>a{display:flex!important;align-items:center!important;gap:12px!important;width:100%!important;border-bottom:none!important}.catalog-page .columns{max-width:100%!important}"},{"filePath":"custom.css","content":"@media (min-width: 1024px){nav#sidebar{height:calc(\n 100dvh - var(--mintlify-slot-header-height, calc(4rem + var(--topbar-tabs-height, 0rem)))\n )!important}}"}],"page":{"pagePath":"api-reference/analytics/run-an-attribution-query","slug":"/api-reference/analytics/run-an-attribution-query","pageMetadata":{"title":"Run an attribution query by UTM source, campaign, or ad","description":"See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.","deprecated":null,"version":null,"sidebarTitle":"Run an attribution query","keywords":["attribution API","UTM attribution","first click attribution","last click attribution","campaign attribution","ad set attribution","Upstack Data API"],"openapi":"/api-reference/openapi.yaml post /db-mgmt/api/query-attribution","href":"/api-reference/analytics/run-an-attribution-query","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Table,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Required scope:`}),` `,_jsx(_components.code,{children:`analytics:read`})]}),`\n`,_jsxs(_components.p,{children:[`This is the endpoint behind the `,_jsx(_components.a,{href:`/analytics/attribution-reporting`,children:`Attribution board`}),`.\nUse it to count new customers per Meta ad set, rank campaigns by attributed revenue\nagainst their spend, or export credit by UTM source on a schedule.\n`,_jsx(_components.a,{href:`/concepts/attribution-and-reporting`,children:`How attribution works`}),` explains how credit is\nassigned.`]}),`\n`,_jsx(Heading,{level:`2`,id:`breakdown-dimensions`,children:`Breakdown dimensions`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`dimension`}),` decides what each row is. Each row also carries the platform IDs for its\ngrain when the click had them.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`dimension`})}),_jsx(_components.th,{children:`One row per`}),_jsx(_components.th,{children:`ID columns on the row`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utm_source`})}),_jsxs(_components.td,{children:[`Traffic source (`,_jsx(_components.code,{children:`Meta Ads`}),`, `,_jsx(_components.code,{children:`Google Ads`}),`, `,_jsx(_components.code,{children:`Klaviyo`}),`, `,_jsx(_components.code,{children:`Direct / (not set)`}),`)`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`mktAccountId`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utm_medium`})}),_jsx(_components.td,{children:`Source and medium`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`mktAccountId`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utm_campaign`})}),_jsx(_components.td,{children:`Campaign`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`mktAccountId`}),`, `,_jsx(_components.code,{children:`mktCampaignId`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utm_source_campaign`})}),_jsx(_components.td,{children:`Source and campaign`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`mktAccountId`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utm_adset`})}),_jsx(_components.td,{children:`Ad set`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`mktAccountId`}),`, `,_jsx(_components.code,{children:`mktAdsetId`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utm_term`})}),_jsxs(_components.td,{children:[`Ad set, keyed on the `,_jsx(_components.code,{children:`utm_term`}),` value`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`mktAccountId`}),`, `,_jsx(_components.code,{children:`mktAdsetId`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utm_ad`})}),_jsx(_components.td,{children:`Ad`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`mktAccountId`}),`, `,_jsx(_components.code,{children:`mktAdId`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`utm_content`})}),_jsxs(_components.td,{children:[`Ad, keyed on the `,_jsx(_components.code,{children:`utm_content`}),` value`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`mktAccountId`}),`, `,_jsx(_components.code,{children:`mktAdId`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Names come from your connected ad platform when the click’s IDs match its data,\notherwise from the UTM value on the click. A campaign with no matching platform data\nshows its raw ID or UTM value as the name. Rows with no value show `,_jsx(_components.code,{children:`(not set)`}),`.\nThe schema accepts other `,_jsx(_components.code,{children:`dimension`}),` values, but they return source-level rows, so\nstick to these eight.`]}),`\n`,_jsx(Heading,{level:`2`,id:`attribution-model-and-window`,children:`Attribution model and window`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`first_click`}),` credits the earliest touchpoint in the window, and `,_jsx(_components.code,{children:`last_click`}),` the\nlatest. Visits with no detectable source only win when the customer has no other\nvisit in the window.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`any_click`}),` credits every source the customer clicked, so rows add up to more than\nthe total. Don’t sum them.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`attributionWindow`}),` is how many days before the order (or the conversion event, with\n`,_jsx(_components.code,{children:`valueSource: events`}),`) to look for touchpoints. `,_jsx(_components.code,{children:`-1`}),` means no limit.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`filtering-results`,children:`Filtering results`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`filters`}),` takes the canonical filter tree. Two families of fields work here.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Matches`}),_jsx(_components.th,{children:`Example value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`attribution.utm_source`})}),_jsx(_components.td,{children:`Source name`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"Meta Ads\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`attribution.utm_campaign`})}),_jsxs(_components.td,{children:[`Campaign name `,_jsx(_components.strong,{children:`or`}),` platform campaign ID`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`\"Spring Sale\"`}),` or `,_jsx(_components.code,{children:`\"120226070802700013\"`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`attribution.utm_adset`}),`, `,_jsx(_components.code,{children:`attribution.utm_term`})]}),_jsxs(_components.td,{children:[`Ad set name `,_jsx(_components.strong,{children:`or`}),` platform ad set ID`]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`\"120244580584300013\"`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`attribution.utm_ad`}),`, `,_jsx(_components.code,{children:`attribution.utm_content`})]}),_jsxs(_components.td,{children:[`Ad name `,_jsx(_components.strong,{children:`or`}),` platform ad ID`]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`\"120244580583740013\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`orders.*`})}),_jsx(_components.td,{children:`The order itself (customer type, source, value, gateway, tags)`}),_jsxs(_components.td,{children:[`See `,_jsx(_components.a,{href:`/api-reference/catalog/list-filter-fields`,children:`List filter fields`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`To filter by campaign ID, put the ID in `,_jsx(_components.code,{children:`attribution.utm_campaign`}),`. The `,_jsx(_components.code,{children:`channel.*`}),`\nfields, such as `,_jsx(_components.code,{children:`channel.campaign_id`}),`, belong to the ad-listing endpoints and return\n`,_jsx(_components.code,{children:`500`}),` here. A value matches every row whose name or ID equals it, across sources, so\nadd an `,_jsx(_components.code,{children:`attribution.utm_source`}),` condition when the same name appears in more than one\nchannel.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`attribution.*`}),` fields only support exact matches today. Use `,_jsx(_components.code,{children:`equals`}),`, or `,_jsx(_components.code,{children:`in`}),`\nfor a list. Other operators that `,_jsx(_components.a,{href:`/api-reference/catalog/list-filter-fields`,children:`List filter fields`}),`\nlists for these fields, such as `,_jsx(_components.code,{children:`not_equals`}),` or `,_jsx(_components.code,{children:`contains`}),`, are accepted but run as\nexact matches: `,_jsx(_components.code,{children:`not_equals \"Meta Ads\"`}),` returns only Meta Ads.\n`,_jsx(_components.code,{children:`attribution.utm_medium`}),` conditions are ignored, and so are `,_jsx(_components.code,{children:`attribution.*`}),`\nconditions inside a `,_jsx(_components.code,{children:`not`}),` group or inside an `,_jsx(_components.code,{children:`and`}),` that is nested in an `,_jsx(_components.code,{children:`or`}),`.\nPut conditions at the top level of an `,_jsx(_components.code,{children:`and`}),`, or in one `,_jsx(_components.code,{children:`or`}),` group under it.`]})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`orders.*`}),` conditions support their full operator set, but only with\n`,_jsx(_components.code,{children:`valueSource: orders`}),`. With `,_jsx(_components.code,{children:`valueSource: events`}),` they’re ignored.`]}),`\n`,_jsx(Heading,{level:`2`,id:`order-settings-aren’t-applied-for-you`,children:`Order settings aren’t applied for you`}),`\n`,_jsxs(_components.p,{children:[`The web app applies your saved `,_jsx(_components.a,{href:`/api-reference/account/get-order-settings`,children:`order settings`}),`\n(pending and voided orders, refund dating, exclusion filters) to attribution. This\nendpoint only uses the `,_jsx(_components.code,{children:`orderSettings`}),` you send. Without them, pending and voided\norders count and nothing is excluded. To match the board, read them with\n`,_jsx(_components.a,{href:`/api-reference/account/get-order-settings`,children:`Get order settings`}),` and pass the returned\nobject as `,_jsx(_components.code,{children:`orderSettings`}),`. Order settings only apply with `,_jsx(_components.code,{children:`valueSource: orders`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`reading-the-response`,children:`Reading the response`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`results`}),` has one entry with `,_jsx(_components.code,{children:`dateRange`}),`, `,_jsx(_components.code,{children:`dimension`}),`, the `,_jsx(_components.code,{children:`filter`}),` you sent,\n`,_jsx(_components.code,{children:`data.primary`}),`, and `,_jsx(_components.code,{children:`measureDetails`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`data.primary`}),` holds one row per dimension value, sorted by `,_jsx(_components.code,{children:`orders.count`}),` (or\n`,_jsx(_components.code,{children:`core.conversions`}),` with `,_jsx(_components.code,{children:`valueSource: events`}),`), highest first. `,_jsx(_components.code,{children:`row_number`}),` gives\nthe position.`]}),`\n`,_jsxs(_components.li,{children:[`Each row carries every measure for the value source, keyed by measure id.\n`,_jsx(_components.code,{children:`valueSource: orders`}),` returns `,_jsx(_components.code,{children:`orders.*`}),` measures (orders, new customers, revenue,\nmargins). `,_jsx(_components.code,{children:`valueSource: events`}),` returns `,_jsx(_components.code,{children:`core.conversions`}),`,\n`,_jsx(_components.code,{children:`core.unique_converters`}),`, `,_jsx(_components.code,{children:`core.conversion_value`}),`, `,_jsx(_components.code,{children:`core.average_conversion_value`}),`,\n`,_jsx(_components.code,{children:`core.cpa`}),`, and `,_jsx(_components.code,{children:`core.roas`}),`. Both add `,_jsx(_components.code,{children:`channel.*`}),` spend and click measures and\n`,_jsx(_components.code,{children:`tracked.*`}),` visitor counts. `,_jsx(_components.code,{children:`measureDetails[].measure`}),` lists every measure id the\nrows carry, with its total.`]}),`\n`,_jsxs(_components.li,{children:[`Values come back as numeric strings (for example `,_jsx(_components.code,{children:`\"66930.1000\"`}),`). A value of zero\ncomes back as `,_jsx(_components.code,{children:`null`}),`. Parse both before doing math.`]}),`\n`,_jsxs(_components.li,{children:[`Each row carries `,_jsx(_components.code,{children:`utm_source`}),`, the column named by `,_jsx(_components.code,{children:`dimension`}),`, and the ID columns\nin the table above. `,_jsx(_components.code,{children:`utm_adset`}),` and `,_jsx(_components.code,{children:`utm_ad`}),` appear on every row, but only hold\nthe row’s own ad set or ad at those two grains, so ignore them elsewhere.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors-and-edge-cases`,children:`Errors and edge cases`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`A malformed `,_jsx(_components.code,{children:`filters`}),` tree returns `,_jsx(_components.code,{children:`400`}),` with the reason in `,_jsx(_components.code,{children:`errors`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`A filter field this endpoint doesn’t accept, an unknown field, or an operator the\nfield doesn’t list returns `,_jsx(_components.code,{children:`500`}),` with the reason in `,_jsx(_components.code,{children:`message`}),`, for example\n`,_jsx(_components.code,{children:`Filter field \"channel.campaign_id\" is not valid for context \"attribution\"`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`When the query itself fails, the response is `,_jsx(_components.code,{children:`200`}),` with an empty body and no\n`,_jsx(_components.code,{children:`results`}),`. Treat that as “no answer”, not “no conversions”.`]}),`\n`,_jsxs(_components.li,{children:[`Ad set and ad breakdowns over long ranges can time out with `,_jsx(_components.code,{children:`502`}),`. Shorten the date\nrange and retry.`]}),`\n`,_jsxs(_components.li,{children:[`Without `,_jsx(_components.code,{children:`timezone`}),`, dates are read as UTC days. `,_jsx(_components.code,{children:`dateRange.end`}),` is inclusive.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`currency`}),` is case-insensitive. A code that isn’t three letters falls back to USD\nwithout an error. See `,_jsx(_components.a,{href:`/concepts/reporting-currency`,children:`Reporting currency`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`pixelId`}),` in the body must equal the `,_jsx(_components.code,{children:`x-pixel-id`}),` header, or the request returns `,_jsx(_components.code,{children:`403`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/cli/query-attribution`,children:_jsx(_components.code,{children:`upstack query-attribution`})}),` runs the same query from the CLI.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/api-reference/catalog/list-filter-fields`,children:`List filter fields`}),` for the fields and operators each endpoint accepts.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/api-reference/account/get-order-settings`,children:`Get order settings`}),` for the `,_jsx(_components.code,{children:`orderSettings`}),` to pass.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/api-reference/analytics/run-an-analytics-query`,children:`Run an analytics query`}),` for unattributed totals and time series.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/guides/attribution/how-to-setup-utm-parameters-for-upstack-data`,children:`Set up UTM parameters`}),` so clicks land in the right campaign.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Run an attribution query by UTM source, campaign, or ad","description":"See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.","deprecated":null,"version":null,"sidebarTitle":"Run an attribution query","keywords":["attribution API","UTM attribution","first click attribution","last click attribution","campaign attribution","ad set attribution","Upstack Data API"],"openapi":"/api-reference/openapi.yaml post /db-mgmt/api/query-attribution","href":"/api-reference/analytics/run-an-attribution-query","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Breakdown dimensions","slug":"breakdown-dimensions","depth":2,"children":[]},{"title":"Attribution model and window","slug":"attribution-model-and-window","depth":2,"children":[]},{"title":"Filtering results","slug":"filtering-results","depth":2,"children":[]},{"title":"Order settings aren’t applied for you","slug":"order-settings-aren’t-applied-for-you","depth":2,"children":[]},{"title":"Reading the response","slug":"reading-the-response","depth":2,"children":[]},{"title":"Errors and edge cases","slug":"errors-and-edge-cases","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/upstackdata-afbed50d/b64b07ede631efed/intercom-customize.js","/_mintlify/custom/upstackdata-afbed50d/1cbfb793dc2ec470/upstack-pixel.js","/_mintlify/custom/upstackdata-afbed50d/e2ccc0353f9bb1f8/sidebar-footer-scroll-fix.js"],"openApiReferenceData":{"operation":{"tags":["Analytics"],"operationId":"queryAttribution","summary":"Run an attribution query","description":"See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.","x-mint":{"metadata":{"title":"Run an attribution query by UTM source, campaign, or ad","sidebarTitle":"Run an attribution query","keywords":["attribution API","UTM attribution","first click attribution","last click attribution","campaign attribution","ad set attribution","Upstack Data API"]},"content":"**Required scope:** `analytics:read`\n\nThis is the endpoint behind the [Attribution board](/analytics/attribution-reporting).\nUse it to count new customers per Meta ad set, rank campaigns by attributed revenue\nagainst their spend, or export credit by UTM source on a schedule.\n[How attribution works](/concepts/attribution-and-reporting) explains how credit is\nassigned.\n\n## Breakdown dimensions\n\n`dimension` decides what each row is. Each row also carries the platform IDs for its\ngrain when the click had them.\n\n| `dimension` | One row per | ID columns on the row |\n| --- | --- | --- |\n| `utm_source` | Traffic source (`Meta Ads`, `Google Ads`, `Klaviyo`, `Direct / (not set)`) | `mktAccountId` |\n| `utm_medium` | Source and medium | `mktAccountId` |\n| `utm_campaign` | Campaign | `mktAccountId`, `mktCampaignId` |\n| `utm_source_campaign` | Source and campaign | `mktAccountId` |\n| `utm_adset` | Ad set | `mktAccountId`, `mktAdsetId` |\n| `utm_term` | Ad set, keyed on the `utm_term` value | `mktAccountId`, `mktAdsetId` |\n| `utm_ad` | Ad | `mktAccountId`, `mktAdId` |\n| `utm_content` | Ad, keyed on the `utm_content` value | `mktAccountId`, `mktAdId` |\n\nNames come from your connected ad platform when the click's IDs match its data,\notherwise from the UTM value on the click. A campaign with no matching platform data\nshows its raw ID or UTM value as the name. Rows with no value show `(not set)`.\nThe schema accepts other `dimension` values, but they return source-level rows, so\nstick to these eight.\n\n## Attribution model and window\n\n- `first_click` credits the earliest touchpoint in the window, and `last_click` the\n latest. Visits with no detectable source only win when the customer has no other\n visit in the window.\n- `any_click` credits every source the customer clicked, so rows add up to more than\n the total. Don't sum them.\n- `attributionWindow` is how many days before the order (or the conversion event, with\n `valueSource: events`) to look for touchpoints. `-1` means no limit.\n\n## Filtering results\n\n`filters` takes the canonical filter tree. Two families of fields work here.\n\n| Field | Matches | Example value |\n| --- | --- | --- |\n| `attribution.utm_source` | Source name | `\"Meta Ads\"` |\n| `attribution.utm_campaign` | Campaign name **or** platform campaign ID | `\"Spring Sale\"` or `\"120226070802700013\"` |\n| `attribution.utm_adset`, `attribution.utm_term` | Ad set name **or** platform ad set ID | `\"120244580584300013\"` |\n| `attribution.utm_ad`, `attribution.utm_content` | Ad name **or** platform ad ID | `\"120244580583740013\"` |\n| `orders.*` | The order itself (customer type, source, value, gateway, tags) | See [List filter fields](/api-reference/catalog/list-filter-fields) |\n\nTo filter by campaign ID, put the ID in `attribution.utm_campaign`. The `channel.*`\nfields, such as `channel.campaign_id`, belong to the ad-listing endpoints and return\n`500` here. A value matches every row whose name or ID equals it, across sources, so\nadd an `attribution.utm_source` condition when the same name appears in more than one\nchannel.\n\n\u003cWarning>\n The `attribution.*` fields only support exact matches today. Use `equals`, or `in`\n for a list. Other operators that [List filter fields](/api-reference/catalog/list-filter-fields)\n lists for these fields, such as `not_equals` or `contains`, are accepted but run as\n exact matches: `not_equals \"Meta Ads\"` returns only Meta Ads.\n `attribution.utm_medium` conditions are ignored, and so are `attribution.*`\n conditions inside a `not` group or inside an `and` that is nested in an `or`.\n Put conditions at the top level of an `and`, or in one `or` group under it.\n\u003c/Warning>\n\n`orders.*` conditions support their full operator set, but only with\n`valueSource: orders`. With `valueSource: events` they're ignored.\n\n## Order settings aren't applied for you\n\nThe web app applies your saved [order settings](/api-reference/account/get-order-settings)\n(pending and voided orders, refund dating, exclusion filters) to attribution. This\nendpoint only uses the `orderSettings` you send. Without them, pending and voided\norders count and nothing is excluded. To match the board, read them with\n[Get order settings](/api-reference/account/get-order-settings) and pass the returned\nobject as `orderSettings`. Order settings only apply with `valueSource: orders`.\n\n## Reading the response\n\n- `results` has one entry with `dateRange`, `dimension`, the `filter` you sent,\n `data.primary`, and `measureDetails`.\n- `data.primary` holds one row per dimension value, sorted by `orders.count` (or\n `core.conversions` with `valueSource: events`), highest first. `row_number` gives\n the position.\n- Each row carries every measure for the value source, keyed by measure id.\n `valueSource: orders` returns `orders.*` measures (orders, new customers, revenue,\n margins). `valueSource: events` returns `core.conversions`,\n `core.unique_converters`, `core.conversion_value`, `core.average_conversion_value`,\n `core.cpa`, and `core.roas`. Both add `channel.*` spend and click measures and\n `tracked.*` visitor counts. `measureDetails[].measure` lists every measure id the\n rows carry, with its total.\n- Values come back as numeric strings (for example `\"66930.1000\"`). A value of zero\n comes back as `null`. Parse both before doing math.\n- Each row carries `utm_source`, the column named by `dimension`, and the ID columns\n in the table above. `utm_adset` and `utm_ad` appear on every row, but only hold\n the row's own ad set or ad at those two grains, so ignore them elsewhere.\n\n## Errors and edge cases\n\n- A malformed `filters` tree returns `400` with the reason in `errors`.\n- A filter field this endpoint doesn't accept, an unknown field, or an operator the\n field doesn't list returns `500` with the reason in `message`, for example\n `Filter field \"channel.campaign_id\" is not valid for context \"attribution\"`.\n- When the query itself fails, the response is `200` with an empty body and no\n `results`. Treat that as \"no answer\", not \"no conversions\".\n- Ad set and ad breakdowns over long ranges can time out with `502`. Shorten the date\n range and retry.\n- Without `timezone`, dates are read as UTC days. `dateRange.end` is inclusive.\n- `currency` is case-insensitive. A code that isn't three letters falls back to USD\n without an error. See [Reporting currency](/concepts/reporting-currency).\n- `pixelId` in the body must equal the `x-pixel-id` header, or the request returns `403`.\n\n## Related\n\n- [`upstack query-attribution`](/cli/query-attribution) runs the same query from the CLI.\n- [List filter fields](/api-reference/catalog/list-filter-fields) for the fields and operators each endpoint accepts.\n- [Get order settings](/api-reference/account/get-order-settings) for the `orderSettings` to pass.\n- [Run an analytics query](/api-reference/analytics/run-an-analytics-query) for unattributed totals and time series.\n- [Set up UTM parameters](/guides/attribution/how-to-setup-utm-parameters-for-upstack-data) so clicks land in the right campaign.\n"},"requestBody":"4c5e7c30-43c4-4069-a22c-163a7d8fa7e7","responses":{"200":"32766e74-b144-41b9-add8-2eb45687593a","400":"bd667fa6-200f-497a-bbd1-f52217db1225","401":"e34d5aaa-7618-4219-8188-49592683d0e4","403":"3600bb76-80c2-4cae-b670-3c7edfbb66c0","500":"384219de-a2b1-4a44-a688-e8968682d8f2"},"method":"post","type":"path","servers":["2bbb3e85-633d-4371-b828-47a29d5899c5"],"security":["f19e0b22-afd0-4760-b88e-dce1773111cb"],"path":"/db-mgmt/api/query-attribution","baseUrlOptions":["https://api.upstackdata.com"],"title":"Run an attribution query","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pixelId","dimension","dateRange","attributionModel","attributionWindow"],"properties":{"pixelId":{"type":"string","description":"Must match the `x-pixel-id` header.","isRequired":true,"uniqueKey":"pixelId","typeLabel":"string"},"dimension":{"type":"string","enum":["utm_source","utm_medium","utm_campaign","utm_source_campaign","utm_adset","utm_term","utm_ad","utm_content"],"description":"What each row attributes credit to. `utm_adset` and `utm_ad` return ad set and ad rows with platform names and IDs.","example":"utm_campaign","isRequired":true,"uniqueKey":"dimension","typeLabel":"enum\u003cstring>"},"dateRange":{"type":"object","required":["start","end"],"description":"Orders (or conversion events) placed in this range are attributed. Touchpoints can fall before `start`, up to the window.","properties":{"start":{"type":"string","format":"date","description":"First day of the range, as an ISO 8601 date.","example":"2026-04-01","isRequired":true,"uniqueKey":"dateRange.start","typeLabel":"string\u003cdate>"},"end":{"type":"string","format":"date","description":"Last day of the range, as an ISO 8601 date. Included in the results.","example":"2026-04-30","isRequired":true,"uniqueKey":"dateRange.end","typeLabel":"string\u003cdate>"}},"isRequired":true,"uniqueKey":"dateRange","typeLabel":"object"},"attributionModel":{"type":"string","enum":["first_click","last_click","any_click"],"description":"Which touchpoint gets credit for a conversion.","isRequired":true,"uniqueKey":"attributionModel","typeLabel":"enum\u003cstring>"},"attributionWindow":{"type":"integer","enum":[1,7,14,30,60,90,-1],"description":"How many days before each conversion to look for touchpoints. `-1` means no limit.","isRequired":true,"uniqueKey":"attributionWindow","typeLabel":"enum\u003cinteger>"},"filters":{"oneOf":[{"type":"object","title":"All of (and)","description":"Narrow the rows with `attribution.utm_*` fields (exact match on name or\nplatform ID) and `orders.*` fields. Only `equals` and `in` behave as\nwritten on `attribution.*` fields.\n","required":["and"],"properties":{"and":{"type":"array","minItems":1,"items":{"oneOf":[{"type":"object","title":"Condition","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","required":["field","op","value"],"properties":{"field":{"type":"string","description":"Canonical filter field id (`\u003cscope>.\u003csnake_case_id>`). Each id is only\nvalid on certain endpoints. [List filter fields](/api-reference/catalog/list-filter-fields)\nreturns the full set and where each one applies.\n","enum":["orders.source_name","orders.customer_type","orders.order_type","orders.value","orders.payment_gateway","orders.tags","channel.resource_name","channel.resource_source","channel.resource_status","channel.resource_configured_status","channel.resource_effective_status","channel.account_id","channel.campaign_id","channel.adset_id","channel.ad_id","channel.account_name","channel.campaign_name","channel.adset_name","channel.ad_name","attribution.utm_source","attribution.utm_medium","attribution.utm_campaign","attribution.utm_adset","attribution.utm_term","attribution.utm_ad","attribution.utm_content","events.event_name","emq.dataset_id","emq.event_name","emq.diagnostic_name"],"isRequired":true,"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.field","typeLabel":"enum\u003cstring>"},"op":{"type":"string","description":"Operator on a filter condition. Each field accepts its own subset, listed in\n`supportedOperators` by [List filter fields](/api-reference/catalog/list-filter-fields).\n","enum":["equals","not_equals","greater_than","less_than","greater_than_or_equals","less_than_or_equals","contains","not_contains","starts_with","ends_with","in","not_in","array_includes","array_includes_all","array_includes_any"],"isRequired":true,"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"value":{"oneOf":[{"type":"string","title":"String","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.0","typeLabel":"string"},{"type":"number","title":"Number","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.1","typeLabel":"number"},{"type":"boolean","title":"Boolean","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.3.items.[INDEX]","typeLabel":"string"},"title":"List of strings","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.3","typeLabel":"string[]"},{"type":"array","items":{"type":"number","uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.4.items.[INDEX]","typeLabel":"number"},"title":"List of numbers","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.4","typeLabel":"number[]"},{"type":"array","items":{"type":"boolean","uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.5.items.[INDEX]","typeLabel":"boolean"},"title":"List of booleans","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.5","typeLabel":"boolean[]"}],"isRequired":true,"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0.value","typeLabel":"string | number | boolean | string[] | number[] | boolean[]"}},"uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.0","typeLabel":"Condition · object"},{"title":"Nested group","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","uniqueKey":"filters.oneOf.0.and.items.[INDEX].oneOf.1","typeLabel":"any"}],"uniqueKey":"filters.oneOf.0.and.items.[INDEX]","typeLabel":"Condition · object | any"},"isRequired":true,"uniqueKey":"filters.oneOf.0.and","typeLabel":"(Condition · object | any)[]"}},"uniqueKey":"filters.oneOf.0","typeLabel":"All of (and) · object"},{"type":"object","title":"Any of (or)","description":"Narrow the rows with `attribution.utm_*` fields (exact match on name or\nplatform ID) and `orders.*` fields. Only `equals` and `in` behave as\nwritten on `attribution.*` fields.\n","required":["or"],"properties":{"or":{"type":"array","minItems":1,"items":{"oneOf":[{"type":"object","title":"Condition","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","required":["field","op","value"],"properties":{"field":{"type":"string","description":"Canonical filter field id (`\u003cscope>.\u003csnake_case_id>`). Each id is only\nvalid on certain endpoints. [List filter fields](/api-reference/catalog/list-filter-fields)\nreturns the full set and where each one applies.\n","enum":["orders.source_name","orders.customer_type","orders.order_type","orders.value","orders.payment_gateway","orders.tags","channel.resource_name","channel.resource_source","channel.resource_status","channel.resource_configured_status","channel.resource_effective_status","channel.account_id","channel.campaign_id","channel.adset_id","channel.ad_id","channel.account_name","channel.campaign_name","channel.adset_name","channel.ad_name","attribution.utm_source","attribution.utm_medium","attribution.utm_campaign","attribution.utm_adset","attribution.utm_term","attribution.utm_ad","attribution.utm_content","events.event_name","emq.dataset_id","emq.event_name","emq.diagnostic_name"],"isRequired":true,"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.field","typeLabel":"enum\u003cstring>"},"op":{"type":"string","description":"Operator on a filter condition. Each field accepts its own subset, listed in\n`supportedOperators` by [List filter fields](/api-reference/catalog/list-filter-fields).\n","enum":["equals","not_equals","greater_than","less_than","greater_than_or_equals","less_than_or_equals","contains","not_contains","starts_with","ends_with","in","not_in","array_includes","array_includes_all","array_includes_any"],"isRequired":true,"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"value":{"oneOf":[{"type":"string","title":"String","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.0","typeLabel":"string"},{"type":"number","title":"Number","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.1","typeLabel":"number"},{"type":"boolean","title":"Boolean","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.3.items.[INDEX]","typeLabel":"string"},"title":"List of strings","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.3","typeLabel":"string[]"},{"type":"array","items":{"type":"number","uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.4.items.[INDEX]","typeLabel":"number"},"title":"List of numbers","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.4","typeLabel":"number[]"},{"type":"array","items":{"type":"boolean","uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.5.items.[INDEX]","typeLabel":"boolean"},"title":"List of booleans","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.5","typeLabel":"boolean[]"}],"isRequired":true,"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0.value","typeLabel":"string | number | boolean | string[] | number[] | boolean[]"}},"uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.0","typeLabel":"Condition · object"},{"title":"Nested group","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","uniqueKey":"filters.oneOf.1.or.items.[INDEX].oneOf.1","typeLabel":"any"}],"uniqueKey":"filters.oneOf.1.or.items.[INDEX]","typeLabel":"Condition · object | any"},"isRequired":true,"uniqueKey":"filters.oneOf.1.or","typeLabel":"(Condition · object | any)[]"}},"uniqueKey":"filters.oneOf.1","typeLabel":"Any of (or) · object"},{"type":"object","title":"Not","description":"Narrow the rows with `attribution.utm_*` fields (exact match on name or\nplatform ID) and `orders.*` fields. Only `equals` and `in` behave as\nwritten on `attribution.*` fields.\n","required":["not"],"properties":{"not":{"oneOf":[{"type":"object","title":"Condition","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","required":["field","op","value"],"properties":{"field":{"type":"string","description":"Canonical filter field id (`\u003cscope>.\u003csnake_case_id>`). Each id is only\nvalid on certain endpoints. [List filter fields](/api-reference/catalog/list-filter-fields)\nreturns the full set and where each one applies.\n","enum":["orders.source_name","orders.customer_type","orders.order_type","orders.value","orders.payment_gateway","orders.tags","channel.resource_name","channel.resource_source","channel.resource_status","channel.resource_configured_status","channel.resource_effective_status","channel.account_id","channel.campaign_id","channel.adset_id","channel.ad_id","channel.account_name","channel.campaign_name","channel.adset_name","channel.ad_name","attribution.utm_source","attribution.utm_medium","attribution.utm_campaign","attribution.utm_adset","attribution.utm_term","attribution.utm_ad","attribution.utm_content","events.event_name","emq.dataset_id","emq.event_name","emq.diagnostic_name"],"isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0.field","typeLabel":"enum\u003cstring>"},"op":{"type":"string","description":"Operator on a filter condition. Each field accepts its own subset, listed in\n`supportedOperators` by [List filter fields](/api-reference/catalog/list-filter-fields).\n","enum":["equals","not_equals","greater_than","less_than","greater_than_or_equals","less_than_or_equals","contains","not_contains","starts_with","ends_with","in","not_in","array_includes","array_includes_all","array_includes_any"],"isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0.op","typeLabel":"enum\u003cstring>"},"value":{"oneOf":[{"type":"string","title":"String","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0.value.oneOf.0","typeLabel":"string"},{"type":"number","title":"Number","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0.value.oneOf.1","typeLabel":"number"},{"type":"boolean","title":"Boolean","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0.value.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","uniqueKey":"filters.oneOf.2.not.oneOf.0.value.oneOf.3.items.[INDEX]","typeLabel":"string"},"title":"List of strings","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0.value.oneOf.3","typeLabel":"string[]"},{"type":"array","items":{"type":"number","uniqueKey":"filters.oneOf.2.not.oneOf.0.value.oneOf.4.items.[INDEX]","typeLabel":"number"},"title":"List of numbers","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0.value.oneOf.4","typeLabel":"number[]"},{"type":"array","items":{"type":"boolean","uniqueKey":"filters.oneOf.2.not.oneOf.0.value.oneOf.5.items.[INDEX]","typeLabel":"boolean"},"title":"List of booleans","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0.value.oneOf.5","typeLabel":"boolean[]"}],"isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0.value","typeLabel":"string | number | boolean | string[] | number[] | boolean[]"}},"isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.0","typeLabel":"Condition · object"},{"title":"Nested group","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","isRequired":true,"uniqueKey":"filters.oneOf.2.not.oneOf.1","typeLabel":"any"}],"isRequired":true,"uniqueKey":"filters.oneOf.2.not","typeLabel":"Condition · object | any"}},"uniqueKey":"filters.oneOf.2","typeLabel":"Not · object"}],"uniqueKey":"filters","typeLabel":"All of (and) · object | Any of (or) · object | Not · object"},"timezone":{"type":"string","description":"IANA timezone (e.g. `America/New_York`) used to read `dateRange` as local days. Omit for UTC.","example":"America/New_York","uniqueKey":"timezone","typeLabel":"string"},"currency":{"type":"string","default":"USD","description":"ISO 4217 code to convert money measures to (e.g. `EUR`). Each\namount converts at the rate for the day it occurred.\n**Defaults to `USD` when omitted**, so if your store sells in\nanother currency, pass this explicitly.\n","uniqueKey":"currency","typeLabel":"string"},"valueSource":{"type":"string","enum":["orders","events"],"default":"orders","description":"What counts as a conversion. `orders` uses store orders and returns `orders.*`\nmeasures. `events` uses the tracked event named in `conversionEvent` and\nreturns `core.*` conversion measures.\n","uniqueKey":"valueSource","typeLabel":"enum\u003cstring>"},"conversionEvent":{"type":"string","default":"purchase","description":"Tracked event name to count as the conversion, in `snake_case` (e.g. `lead`).\nRequired when `valueSource` is `events`. Ignored for `orders`.\n","uniqueKey":"conversionEvent","typeLabel":"string"},"orderSettings":{"type":"object","description":"Order settings to apply to this query. The query endpoints don't read the account's\nsaved order settings, so pass them here to match the web app's numbers. The\n`orderSettings` object returned by [Get order settings](/api-reference/account/get-order-settings)\ncan be passed as-is.\n","properties":{"countPendingOrders":{"type":"boolean","description":"Include pending orders.","uniqueKey":"orderSettings.countPendingOrders","typeLabel":"boolean"},"countVoidedOrders":{"type":"boolean","description":"Include voided orders.","uniqueKey":"orderSettings.countVoidedOrders","typeLabel":"boolean"},"refundDateAttribution":{"type":"string","enum":["refund_date","order_date"],"description":"Which date a refund is counted on.\n- `refund_date`: the day the refund was processed, matching Shopify. The default.\n- `order_date`: the date of the original order.\n","uniqueKey":"orderSettings.refundDateAttribution","typeLabel":"enum\u003cstring>"},"exclusionFilters":{"type":"array","description":"Orders matching any enabled filter are left out of the query. On this path every\nfilter, condition group, and condition must carry its `id`, and every condition\nneeds a `value`, including `exists` and `not_exists`.\n","items":{"type":"object","required":["name","enabled","conditionGroups"],"description":"A single exclusion filter. An order that matches any enabled filter is\nleft out of reporting. The server assigns `id` and `createdAt` when you\nleave them out, and sets `updatedAt` on every save. Max 20 condition\ngroups per filter.\n","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"Exclude POS","description":"Display name. Control / zero-width / bidi characters rejected;\nunicode letters, marks, digits, punctuation, and emoji accepted.\n","isRequired":true,"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].name","typeLabel":"string"},"enabled":{"type":"boolean","description":"Only enabled filters exclude orders. Must be a JSON boolean, not a string.","isRequired":true,"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].enabled","typeLabel":"boolean"},"conditionGroups":{"type":"array","minItems":1,"maxItems":20,"description":"The order is excluded when any one group matches.","items":{"type":"object","required":["logic","conditions"],"description":"Group of conditions joined by `logic`. Within a filter, groups\nare OR'd; within a group, conditions are joined by the group's\n`logic`. Max 20 conditions per group.\n","properties":{"logic":{"type":"string","enum":["and","or"],"isRequired":true,"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].logic","typeLabel":"enum\u003cstring>"},"conditions":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","required":["field","operator"],"description":"Single condition inside a group. The server assigns `id` (a UUID) when you\nleave it out; send it back on later updates to keep the condition's identity.\n`value` is required for every operator except `exists` and `not_exists`.\n","properties":{"field":{"type":"string","enum":["sourceName","tags","value","paymentGateway"],"description":"Order field a condition is evaluated against. Each field accepts only\nthe operators that suit its type, listed under `ConditionOperator`.\n","isRequired":true,"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX].field","typeLabel":"enum\u003cstring>"},"operator":{"type":"string","enum":["equals","not_equals","in","not_in","contains","not_contains","starts_with","ends_with","greater_than","less_than","greater_than_or_equals","less_than_or_equals","exists","not_exists","array_includes","array_includes_all","array_includes_any"],"description":"Comparison operator. It has to suit the field's type\n(string / array / number) — a numeric operator on a string field, such as\n`greater_than` on `sourceName`, is rejected with 400.\n","isRequired":true,"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX].operator","typeLabel":"enum\u003cstring>"},"id":{"type":"string","format":"uuid","description":"Condition id. Omit on new conditions.","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX].id","typeLabel":"string\u003cuuid>"},"value":{"oneOf":[{"type":"string","title":"String","description":"The value to compare against. Use a list of strings with `in`, `not_in`, and the\n`array_includes*` operators; a number with `value`; a string otherwise.\n","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX].value.oneOf.0","typeLabel":"string"},{"type":"number","title":"Number","description":"The value to compare against. Use a list of strings with `in`, `not_in`, and the\n`array_includes*` operators; a number with `value`; a string otherwise.\n","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX].value.oneOf.1","typeLabel":"number"},{"type":"boolean","title":"Boolean","description":"The value to compare against. Use a list of strings with `in`, `not_in`, and the\n`array_includes*` operators; a number with `value`; a string otherwise.\n","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX].value.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX].value.oneOf.3.items.[INDEX]","typeLabel":"string"},"title":"List of strings","description":"The value to compare against. Use a list of strings with `in`, `not_in`, and the\n`array_includes*` operators; a number with `value`; a string otherwise.\n","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX].value.oneOf.3","typeLabel":"string[]"}],"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX].value","typeLabel":"string | number | boolean | string[]"}},"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].conditions","typeLabel":"object[]"},"id":{"type":"string","format":"uuid","description":"Group id. Omit on new groups; the server assigns one.","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX].id","typeLabel":"string\u003cuuid>"}},"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].conditionGroups","typeLabel":"object[]"},"id":{"type":"string","format":"uuid","description":"Filter id. Omit on new filters; send it back to keep the filter's identity.","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].id","typeLabel":"string\u003cuuid>"},"createdAt":{"type":"string","format":"date-time","description":"When the filter was created. Send it back unchanged to keep it; omit it and it resets to the time of the request.","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].createdAt","typeLabel":"string\u003cdate-time>"},"updatedAt":{"type":"string","format":"date-time","description":"Set by the server to the time of the last save. Any value you send is overwritten.","uniqueKey":"orderSettings.exclusionFilters.items.[INDEX].updatedAt","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"orderSettings.exclusionFilters.items.[INDEX]","typeLabel":"object"},"uniqueKey":"orderSettings.exclusionFilters","typeLabel":"object[]"}},"uniqueKey":"orderSettings","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"firstClickByUtmSource":{"title":"firstClickByUtmSource","value":{"pixelId":"5f1e6a4f-...","dimension":"utm_source","dateRange":{"start":"2026-04-01","end":"2026-04-30"},"attributionModel":"first_click","attributionWindow":30,"timezone":"America/New_York"}},"newCustomersByAdSet":{"title":"newCustomersByAdSet","value":{"pixelId":"5f1e6a4f-...","dimension":"utm_adset","dateRange":{"start":"2026-10-01","end":"2026-10-07"},"attributionModel":"last_click","attributionWindow":7,"filters":{"and":[{"field":"attribution.utm_source","op":"equals","value":"Meta Ads"}]}}},"campaignById":{"title":"campaignById","value":{"pixelId":"5f1e6a4f-...","dimension":"utm_campaign","dateRange":{"start":"2026-10-01","end":"2026-10-07"},"attributionModel":"last_click","attributionWindow":30,"filters":{"and":[{"field":"attribution.utm_campaign","op":"equals","value":"120226070802700013"}]}}},"scopedToGoogle":{"title":"scopedToGoogle","value":{"pixelId":"5f1e6a4f-...","dimension":"utm_campaign","dateRange":{"start":"2026-04-01","end":"2026-04-30"},"attributionModel":"last_click","attributionWindow":30,"filters":{"and":[{"field":"attribution.utm_source","op":"equals","value":"Google Ads"},{"field":"orders.customer_type","op":"in","value":["new_customer"]}]}}},"eventsValueSource":{"title":"eventsValueSource","value":{"pixelId":"5f1e6a4f-...","dimension":"utm_campaign","dateRange":{"start":"2026-04-01","end":"2026-04-30"},"attributionModel":"first_click","attributionWindow":-1,"valueSource":"events","conversionEvent":"lead"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"32766e74-b144-41b9-add8-2eb45687593a":{"description":"Attribution results.","content":{"application/json":{"schema":{"type":"object","description":"`results` is absent when the attribution query couldn't be run — the response is\nthen an empty object with a `200`. Treat a missing `results` as \"no answer\", not\nas \"no conversions\": an empty `results` array is the real no-data case.\n","properties":{"results":{"type":"array","items":{"type":"object","properties":{"dateRange":{"type":"object","required":["start","end"],"description":"The range queried, converted to UTC timestamps with the end of day applied.","properties":{"start":{"type":"string","format":"date","description":"First day of the range, as an ISO 8601 date.","example":"2026-04-01","isRequired":true,"uniqueKey":"results.items.[INDEX].dateRange.start","typeLabel":"string\u003cdate>"},"end":{"type":"string","format":"date","description":"Last day of the range, as an ISO 8601 date. Included in the results.","example":"2026-04-30","isRequired":true,"uniqueKey":"results.items.[INDEX].dateRange.end","typeLabel":"string\u003cdate>"}},"uniqueKey":"results.items.[INDEX].dateRange","typeLabel":"object"},"dimension":{"type":"string","description":"The `dimension` you requested.","uniqueKey":"results.items.[INDEX].dimension","typeLabel":"string"},"filter":{"oneOf":[{"type":"object","title":"All of (and)","description":"The `filters` tree you sent. Absent when you sent none.","required":["and"],"properties":{"and":{"type":"array","minItems":1,"items":{"oneOf":[{"type":"object","title":"Condition","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","required":["field","op","value"],"properties":{"field":{"type":"string","description":"Canonical filter field id (`\u003cscope>.\u003csnake_case_id>`). Each id is only\nvalid on certain endpoints. [List filter fields](/api-reference/catalog/list-filter-fields)\nreturns the full set and where each one applies.\n","enum":["orders.source_name","orders.customer_type","orders.order_type","orders.value","orders.payment_gateway","orders.tags","channel.resource_name","channel.resource_source","channel.resource_status","channel.resource_configured_status","channel.resource_effective_status","channel.account_id","channel.campaign_id","channel.adset_id","channel.ad_id","channel.account_name","channel.campaign_name","channel.adset_name","channel.ad_name","attribution.utm_source","attribution.utm_medium","attribution.utm_campaign","attribution.utm_adset","attribution.utm_term","attribution.utm_ad","attribution.utm_content","events.event_name","emq.dataset_id","emq.event_name","emq.diagnostic_name"],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.field","typeLabel":"enum\u003cstring>"},"op":{"type":"string","description":"Operator on a filter condition. Each field accepts its own subset, listed in\n`supportedOperators` by [List filter fields](/api-reference/catalog/list-filter-fields).\n","enum":["equals","not_equals","greater_than","less_than","greater_than_or_equals","less_than_or_equals","contains","not_contains","starts_with","ends_with","in","not_in","array_includes","array_includes_all","array_includes_any"],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"value":{"oneOf":[{"type":"string","title":"String","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.0","typeLabel":"string"},{"type":"number","title":"Number","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.1","typeLabel":"number"},{"type":"boolean","title":"Boolean","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.3.items.[INDEX]","typeLabel":"string"},"title":"List of strings","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.3","typeLabel":"string[]"},{"type":"array","items":{"type":"number","uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.4.items.[INDEX]","typeLabel":"number"},"title":"List of numbers","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.4","typeLabel":"number[]"},{"type":"array","items":{"type":"boolean","uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.5.items.[INDEX]","typeLabel":"boolean"},"title":"List of booleans","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value.oneOf.5","typeLabel":"boolean[]"}],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0.value","typeLabel":"string | number | boolean | string[] | number[] | boolean[]"}},"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.0","typeLabel":"Condition · object"},{"title":"Nested group","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX].oneOf.1","typeLabel":"any"}],"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and.items.[INDEX]","typeLabel":"Condition · object | any"},"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.0.and","typeLabel":"(Condition · object | any)[]"}},"uniqueKey":"results.items.[INDEX].filter.oneOf.0","typeLabel":"All of (and) · object"},{"type":"object","title":"Any of (or)","description":"The `filters` tree you sent. Absent when you sent none.","required":["or"],"properties":{"or":{"type":"array","minItems":1,"items":{"oneOf":[{"type":"object","title":"Condition","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","required":["field","op","value"],"properties":{"field":{"type":"string","description":"Canonical filter field id (`\u003cscope>.\u003csnake_case_id>`). Each id is only\nvalid on certain endpoints. [List filter fields](/api-reference/catalog/list-filter-fields)\nreturns the full set and where each one applies.\n","enum":["orders.source_name","orders.customer_type","orders.order_type","orders.value","orders.payment_gateway","orders.tags","channel.resource_name","channel.resource_source","channel.resource_status","channel.resource_configured_status","channel.resource_effective_status","channel.account_id","channel.campaign_id","channel.adset_id","channel.ad_id","channel.account_name","channel.campaign_name","channel.adset_name","channel.ad_name","attribution.utm_source","attribution.utm_medium","attribution.utm_campaign","attribution.utm_adset","attribution.utm_term","attribution.utm_ad","attribution.utm_content","events.event_name","emq.dataset_id","emq.event_name","emq.diagnostic_name"],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.field","typeLabel":"enum\u003cstring>"},"op":{"type":"string","description":"Operator on a filter condition. Each field accepts its own subset, listed in\n`supportedOperators` by [List filter fields](/api-reference/catalog/list-filter-fields).\n","enum":["equals","not_equals","greater_than","less_than","greater_than_or_equals","less_than_or_equals","contains","not_contains","starts_with","ends_with","in","not_in","array_includes","array_includes_all","array_includes_any"],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.op","typeLabel":"enum\u003cstring>"},"value":{"oneOf":[{"type":"string","title":"String","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.0","typeLabel":"string"},{"type":"number","title":"Number","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.1","typeLabel":"number"},{"type":"boolean","title":"Boolean","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.3.items.[INDEX]","typeLabel":"string"},"title":"List of strings","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.3","typeLabel":"string[]"},{"type":"array","items":{"type":"number","uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.4.items.[INDEX]","typeLabel":"number"},"title":"List of numbers","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.4","typeLabel":"number[]"},{"type":"array","items":{"type":"boolean","uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.5.items.[INDEX]","typeLabel":"boolean"},"title":"List of booleans","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value.oneOf.5","typeLabel":"boolean[]"}],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0.value","typeLabel":"string | number | boolean | string[] | number[] | boolean[]"}},"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.0","typeLabel":"Condition · object"},{"title":"Nested group","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX].oneOf.1","typeLabel":"any"}],"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or.items.[INDEX]","typeLabel":"Condition · object | any"},"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.1.or","typeLabel":"(Condition · object | any)[]"}},"uniqueKey":"results.items.[INDEX].filter.oneOf.1","typeLabel":"Any of (or) · object"},{"type":"object","title":"Not","description":"The `filters` tree you sent. Absent when you sent none.","required":["not"],"properties":{"not":{"oneOf":[{"type":"object","title":"Condition","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","required":["field","op","value"],"properties":{"field":{"type":"string","description":"Canonical filter field id (`\u003cscope>.\u003csnake_case_id>`). Each id is only\nvalid on certain endpoints. [List filter fields](/api-reference/catalog/list-filter-fields)\nreturns the full set and where each one applies.\n","enum":["orders.source_name","orders.customer_type","orders.order_type","orders.value","orders.payment_gateway","orders.tags","channel.resource_name","channel.resource_source","channel.resource_status","channel.resource_configured_status","channel.resource_effective_status","channel.account_id","channel.campaign_id","channel.adset_id","channel.ad_id","channel.account_name","channel.campaign_name","channel.adset_name","channel.ad_name","attribution.utm_source","attribution.utm_medium","attribution.utm_campaign","attribution.utm_adset","attribution.utm_term","attribution.utm_ad","attribution.utm_content","events.event_name","emq.dataset_id","emq.event_name","emq.diagnostic_name"],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.field","typeLabel":"enum\u003cstring>"},"op":{"type":"string","description":"Operator on a filter condition. Each field accepts its own subset, listed in\n`supportedOperators` by [List filter fields](/api-reference/catalog/list-filter-fields).\n","enum":["equals","not_equals","greater_than","less_than","greater_than_or_equals","less_than_or_equals","contains","not_contains","starts_with","ends_with","in","not_in","array_includes","array_includes_all","array_includes_any"],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.op","typeLabel":"enum\u003cstring>"},"value":{"oneOf":[{"type":"string","title":"String","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value.oneOf.0","typeLabel":"string"},{"type":"number","title":"Number","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value.oneOf.1","typeLabel":"number"},{"type":"boolean","title":"Boolean","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value.oneOf.3.items.[INDEX]","typeLabel":"string"},"title":"List of strings","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value.oneOf.3","typeLabel":"string[]"},{"type":"array","items":{"type":"number","uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value.oneOf.4.items.[INDEX]","typeLabel":"number"},"title":"List of numbers","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value.oneOf.4","typeLabel":"number[]"},{"type":"array","items":{"type":"boolean","uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value.oneOf.5.items.[INDEX]","typeLabel":"boolean"},"title":"List of booleans","description":"Scalar (`string` / `number` / `boolean`) for equality / comparison /\n`contains` operators. Array of scalars for `in`, `not_in`, and\n`array_includes_*` operators.\n","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value.oneOf.5","typeLabel":"boolean[]"}],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0.value","typeLabel":"string | number | boolean | string[] | number[] | boolean[]"}},"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.0","typeLabel":"Condition · object"},{"title":"Nested group","description":"Either a `FilterCondition` leaf or a nested `FilterGroup`.","isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not.oneOf.1","typeLabel":"any"}],"isRequired":true,"uniqueKey":"results.items.[INDEX].filter.oneOf.2.not","typeLabel":"Condition · object | any"}},"uniqueKey":"results.items.[INDEX].filter.oneOf.2","typeLabel":"Not · object"}],"uniqueKey":"results.items.[INDEX].filter","typeLabel":"All of (and) · object | Any of (or) · object | Not · object"},"data":{"type":"object","properties":{"primary":{"type":"array","description":"One row per dimension value, sorted by `orders.count` (or `core.conversions`\nfor `valueSource: events`), highest first. Each row has `row_number`,\n`utm_source`, the requested dimension column, platform ID columns\n(`mktAccountId`, `mktCampaignId`, `mktAdsetId`, `mktAdId`) for its grain, and\none key per measure. Values are numeric strings, and zero comes back as `null`.\n","items":{"type":"object","additionalProperties":true,"uniqueKey":"results.items.[INDEX].data.primary.items.[INDEX]","typeLabel":"object"},"uniqueKey":"results.items.[INDEX].data.primary","typeLabel":"object[]"}},"uniqueKey":"results.items.[INDEX].data","typeLabel":"object"},"measureDetails":{"type":"array","description":"One entry per measure on the rows. Entries for summed measures carry `isSum: true`\nand `primarySum`. Entries for ratios carry `isAverage: true` and, when it can be\ncomputed, `primaryAvg`. `isCurrency` marks money measures.\n","items":{"type":"object","description":"Totals and formatting hints for one requested measure.","properties":{"measure":{"type":"string","description":"The measure id this entry describes.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].measure","typeLabel":"string"},"isAverage":{"type":"boolean","description":"The measure is an average, so read `primaryAvg` rather than `primarySum` as its headline value.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].isAverage","typeLabel":"boolean"},"isPercentage":{"type":"boolean","description":"The value is a percentage.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].isPercentage","typeLabel":"boolean"},"calculatedAverage":{"type":"boolean","description":"The average is calculated from the period's totals rather than averaged across rows.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].calculatedAverage","typeLabel":"boolean"},"success":{"type":"boolean","description":"Whether this measure was computed. When `false`, the measure's query failed\nand its totals are all `0`, so check this before treating a zero as real. The\nrequest still returns `200` and the other measures still carry their data.\n","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].success","typeLabel":"boolean"},"primaryAvg":{"type":"number","description":"Average value over `dateRange`.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].primaryAvg","typeLabel":"number"},"compareAvg":{"type":"number","description":"Average value over the comparison period.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].compareAvg","typeLabel":"number"},"primarySum":{"type":"number","description":"Total over `dateRange`.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].primarySum","typeLabel":"number"},"compareSum":{"type":"number","description":"Total over the comparison period.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].compareSum","typeLabel":"number"},"percentDiff":{"type":"number","description":"Percent change from the comparison period to `dateRange`.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].percentDiff","typeLabel":"number"},"hasPacing":{"type":"boolean","description":"Pacing data is included. `true` only when you asked for `pacing` and the measure supports it.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].hasPacing","typeLabel":"boolean"},"preferredTrendDirection":{"type":"string","enum":["up","down"],"description":"Whether higher (`up`) or lower (`down`) values are favorable.","uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX].preferredTrendDirection","typeLabel":"enum\u003cstring>"}},"uniqueKey":"results.items.[INDEX].measureDetails.items.[INDEX]","typeLabel":"object"},"uniqueKey":"results.items.[INDEX].measureDetails","typeLabel":"object[]"}},"uniqueKey":"results.items.[INDEX]","typeLabel":"object"},"uniqueKey":"results","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"results":[{"dateRange":{"start":"2026-04-01","end":"2026-04-30"},"dimension":"\u003cstring>","filter":{"and":[{"field":"orders.source_name","op":"equals","value":"\u003cstring>"}]},"data":{"primary":[{}]},"measureDetails":[{"measure":"\u003cstring>","isAverage":true,"isPercentage":true,"calculatedAverage":true,"success":true,"primaryAvg":123,"compareAvg":123,"primarySum":123,"compareSum":123,"percentDiff":123,"hasPacing":true,"preferredTrendDirection":"up"}]}]}}},"exampleType":"generated"}},"exampleType":"generated"},"bd667fa6-200f-497a-bbd1-f52217db1225":{"description":"Validation error. Includes an `errors` array with per-field detail.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"errors":{"type":"array","description":"Per-field validation errors (present on 400 responses).","items":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"errors.items.[INDEX].message","typeLabel":"string"},"key":{"type":"string","uniqueKey":"errors.items.[INDEX].key","typeLabel":"string"},"path":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX].path.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors.items.[INDEX].path","typeLabel":"string[]"}},"uniqueKey":"errors.items.[INDEX]","typeLabel":"object"},"uniqueKey":"errors","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>","errors":[{"message":"\u003cstring>","key":"\u003cstring>","path":["\u003cstring>"]}]}}},"exampleType":"generated"}},"exampleType":"generated"},"e34d5aaa-7618-4219-8188-49592683d0e4":{"description":"The `x-api-key` or `x-pixel-id` header is missing. The request is rejected\nbefore it reaches the API, and the body is `{\"message\": \"Unauthorized\"}`.\nA key that is present but not accepted returns `403`, not `401`.\n","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"errors":{"type":"array","description":"Per-field validation errors (present on 400 responses).","items":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"errors.items.[INDEX].message","typeLabel":"string"},"key":{"type":"string","uniqueKey":"errors.items.[INDEX].key","typeLabel":"string"},"path":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX].path.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors.items.[INDEX].path","typeLabel":"string[]"}},"uniqueKey":"errors.items.[INDEX]","typeLabel":"object"},"uniqueKey":"errors","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>","errors":[{"message":"\u003cstring>","key":"\u003cstring>","path":["\u003cstring>"]}]}}},"exampleType":"generated"}},"exampleType":"generated"},"3600bb76-80c2-4cae-b670-3c7edfbb66c0":{"description":"The key was rejected, or it is valid but not allowed to do this. Either:\n\n- the key is unknown, revoked, or expired, or the pixel is inactive — the body is\n `{\"Message\": \"User is not authorized to access this resource with an explicit deny\n in an identity-based policy\"}` (note the capital `M`);\n- the key doesn't carry the scope this endpoint needs, or the body `pixelId` doesn't\n match the `x-pixel-id` header — the body is `{\"message\": \"…\"}` as described below.\n","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"errors":{"type":"array","description":"Per-field validation errors (present on 400 responses).","items":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"errors.items.[INDEX].message","typeLabel":"string"},"key":{"type":"string","uniqueKey":"errors.items.[INDEX].key","typeLabel":"string"},"path":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX].path.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors.items.[INDEX].path","typeLabel":"string[]"}},"uniqueKey":"errors.items.[INDEX]","typeLabel":"object"},"uniqueKey":"errors","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>","errors":[{"message":"\u003cstring>","key":"\u003cstring>","path":["\u003cstring>"]}]}}},"exampleType":"generated"}},"exampleType":"generated"},"384219de-a2b1-4a44-a688-e8968682d8f2":{"description":"The query failed. The body carries the underlying failure message.\n","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"errors":{"type":"array","description":"Per-field validation errors (present on 400 responses).","items":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"errors.items.[INDEX].message","typeLabel":"string"},"key":{"type":"string","uniqueKey":"errors.items.[INDEX].key","typeLabel":"string"},"path":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX].path.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors.items.[INDEX].path","typeLabel":"string[]"}},"uniqueKey":"errors.items.[INDEX]","typeLabel":"object"},"uniqueKey":"errors","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>","errors":[{"message":"\u003cstring>","key":"\u003cstring>","path":["\u003cstring>"]}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"f19e0b22-afd0-4760-b88e-dce1773111cb":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Upstack API key. Starts with `upstack_`.","scopes":[],"schemeName":"apiKey"},"pixelId":{"type":"apiKey","in":"header","name":"x-pixel-id","description":"The pixel id the request targets.","scopes":[],"schemeName":"pixelId"}}},"servers":{"2bbb3e85-633d-4371-b828-47a29d5899c5":{"url":"https://api.upstackdata.com","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your Upstack API key. Starts with `upstack_`.","scopes":[],"schemeName":"apiKey"},"schema":{"title":"x-api-key","type":"string","description":"Your Upstack API key. Starts with `upstack_`.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"apiKey","name":"x-api-key"},{"scheme":{"type":"apiKey","in":"header","name":"x-pixel-id","description":"The pixel id the request targets.","scopes":[],"schemeName":"pixelId"},"schema":{"title":"x-pixel-id","type":"string","description":"The pixel id the request targets.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"pixelId","name":"x-pixel-id"}],"title":"apiKey \u0026 pixelId"}]},"originalFileLocation":"api-reference/openapi.yaml"},"subdomain":"upstackdata-afbed50d","siteName":"Upstack Data","title":"Run an attribution query by UTM source, campaign, or ad - Upstack Data","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-04T13:39:43.835Z","originalFileLocation":"api-reference/analytics/run-an-attribution-query.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Upstack Data\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Run an attribution query by UTM source, campaign, or ad - Upstack Data\">\u003cmeta data-mint-head property=\"og:description\" content=\"See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Upstack Data\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://upstackdata-afbed50d.mintlify.site/_mintlify/api/og/v2?division=ANALYTICS\u0026amp;title=Run+an+attribution+query+by+UTM+source%2C+campaign%2C+or+ad\u0026amp;description=See+which+UTM+source%2C+campaign%2C+ad+set%2C+or+ad+gets+credit+for+your+orders+or+conversion+events%2C+with+revenue%2C+new+customers%2C+ad+spend%2C+and+ROAS+on+every+row.\u0026amp;theme=b279b8bf440b9d86f43d4b66\u0026amp;signature=2b926c058277e9f95a1b95f4a9be841e7fbd7a1f72753e7a9811fc4cd84b476e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Run an attribution query by UTM source, campaign, or ad - Upstack Data\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://upstackdata-afbed50d.mintlify.site/_mintlify/api/og/v2?division=ANALYTICS\u0026amp;title=Run+an+attribution+query+by+UTM+source%2C+campaign%2C+or+ad\u0026amp;description=See+which+UTM+source%2C+campaign%2C+ad+set%2C+or+ad+gets+credit+for+your+orders+or+conversion+events%2C+with+revenue%2C+new+customers%2C+ad+spend%2C+and+ROAS+on+every+row.\u0026amp;theme=b279b8bf440b9d86f43d4b66\u0026amp;signature=2b926c058277e9f95a1b95f4a9be841e7fbd7a1f72753e7a9811fc4cd84b476e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/upstackdata-afbed50d/3BK6qL6Jr5lRaaY0/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Upstack Data\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4230b4\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/analytics/run-an-attribution-query.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.upstackdata.com/#organization\",\"name\":\"Upstack Data\",\"url\":\"https://docs.upstackdata.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/upstackdata-afbed50d/40dgTTn1PLjePhJa/logo/light.svg?fit=max\u0026auto=format\u0026n=40dgTTn1PLjePhJa\u0026q=85\u0026s=598c05fb87860ddc1b6b7640b41e136c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.upstackdata.com#website\",\"name\":\"Upstack Data\",\"url\":\"https://docs.upstackdata.com\",\"publisher\":{\"@id\":\"https://docs.upstackdata.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query#webpage\",\"url\":\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query\",\"name\":\"Run an attribution query by UTM source, campaign, or ad\",\"description\":\"See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.\",\"dateModified\":\"2026-11-04T13:39:43.835Z\",\"isPartOf\":{\"@id\":\"https://docs.upstackdata.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"ANALYTICS\",\"item\":\"https://docs.upstackdata.com/api-reference/analytics/run-an-analytics-query\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Run an attribution query by UTM source, campaign, or ad\",\"item\":\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query#apireference\",\"headline\":\"Run an attribution query by UTM source, campaign, or ad\",\"name\":\"Run an attribution query by UTM source, campaign, or ad\",\"description\":\"See which UTM source, campaign, ad set, or ad gets credit for your orders or conversion events, with revenue, new customers, ad spend, and ROAS on every row.\",\"url\":\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query\",\"mainEntityOfPage\":{\"@id\":\"https://docs.upstackdata.com/api-reference/analytics/run-an-attribution-query#webpage\"},\"dateModified\":\"2026-11-04T13:39:43.835Z\",\"keywords\":\"attribution API, UTM attribution, first click attribution, last click attribution, campaign attribution, ad set attribution, Upstack Data API\",\"publisher\":{\"@id\":\"https://docs.upstackdata.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.upstackdata.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Upstack Data\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Upstack Data\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/analytics/run-an-attribution-query.md","siteName":"Upstack Data","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/get-started/overview"}]},{"tab":"Pixel","pages":[{"title":"Pixel","href":"/pixel"}]},{"tab":"Event Tracking","pages":[{"title":"Event Tracking","href":"/event-tracking"}]},{"tab":"Metrics","pages":[{"title":"Metrics","href":"/reference/metrics"}]},{"tab":"API","groups":[{"group":"OVERVIEW","pages":[{"title":"Introduction","sidebarTitle":"Introduction","href":"/api-reference/introduction"},{"title":"Errors","sidebarTitle":"Errors","href":"/api-reference/errors"},{"title":"Rate limiting","sidebarTitle":"Rate limiting","href":"/api-reference/rate-limiting"}]},{"group":"ACCOUNT","pages":[{"title":"Get account details, owners, and subscription plan","deprecated":null,"version":null,"sidebarTitle":"Get the account","openapi":"/api-reference/openapi.yaml get /accounts/api/account","href":"/api-reference/account/get-the-account"},{"title":"Rename the account","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml patch /accounts/api/account","href":"/api-reference/account/rename-the-account"},{"title":"Get order settings and order exclusion filters","deprecated":null,"version":null,"sidebarTitle":"Get order settings","openapi":"/api-reference/openapi.yaml get /accounts/api/account/settings/order","href":"/api-reference/account/get-order-settings"},{"title":"Replace order settings and order exclusion filters","deprecated":null,"version":null,"sidebarTitle":"Replace order settings","openapi":"/api-reference/openapi.yaml put /accounts/api/account/settings/order","href":"/api-reference/account/replace-order-settings"}]},{"group":"CATALOG","pages":[{"title":"List available measures","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /db-mgmt/api/measures","href":"/api-reference/catalog/list-available-measures"},{"title":"List filter fields for analytics queries","deprecated":null,"version":null,"sidebarTitle":"List filter fields","openapi":"/api-reference/openapi.yaml get /db-mgmt/api/filters","href":"/api-reference/catalog/list-filter-fields"}]},{"group":"ANALYTICS","pages":[{"title":"Run an analytics query with measures and dimensions","description":"Query revenue, orders, ad spend, ROAS, and any other measure for a date range, as a daily, weekly, or monthly series or broken down by up to five dimensions.","deprecated":null,"version":null,"sidebarTitle":"Run an analytics query","openapi":"/api-reference/openapi.yaml post /db-mgmt/api/query","href":"/api-reference/analytics/run-an-analytics-query"},{"title":"Run an attribution query by UTM source, campaign, or ad","deprecated":null,"version":null,"sidebarTitle":"Run an attribution query","openapi":"/api-reference/openapi.yaml post /db-mgmt/api/query-attribution","href":"/api-reference/analytics/run-an-attribution-query"},{"title":"Run a cohort analysis for customer LTV and retention","description":"Group customers by the week, month, or year of their first order and track cumulative revenue per customer, retention, AOV, and contribution margin over time.","deprecated":null,"version":null,"sidebarTitle":"Run a cohort analysis","openapi":"/api-reference/openapi.yaml post /db-mgmt/api/query-cohort-analysis","href":"/api-reference/analytics/run-a-cohort-analysis"},{"title":"List channel entities with optional metrics","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /db-mgmt/api/query-channel-details","href":"/api-reference/analytics/list-channel-entities-with-optional-metrics"},{"title":"List ads with daily spend and performance metrics","deprecated":null,"version":null,"sidebarTitle":"List ads with metrics","openapi":"/api-reference/openapi.yaml post /db-mgmt/api/query-ads","href":"/api-reference/analytics/list-ads-with-optional-daily-metrics"}]},{"group":"DASHBOARDS","pages":[{"title":"List dashboard views for a pixel","deprecated":null,"version":null,"sidebarTitle":"List dashboard views","openapi":"/api-reference/openapi.yaml get /accounts/api/dashboard/views","href":"/api-reference/dashboards/list-dashboard-views"},{"title":"Get a dashboard view and its widget configuration","deprecated":null,"version":null,"sidebarTitle":"Get a dashboard view","openapi":"/api-reference/openapi.yaml get /accounts/api/dashboard/views/{dashboardViewId}","href":"/api-reference/dashboards/get-a-dashboard-view"},{"title":"Create a dashboard view from a full configuration","deprecated":null,"version":null,"sidebarTitle":"Create a dashboard view","openapi":"/api-reference/openapi.yaml post /accounts/api/dashboard/views","href":"/api-reference/dashboards/create-a-dashboard-view"},{"title":"Build a dashboard from a list of measures","deprecated":null,"version":null,"sidebarTitle":"Build a dashboard from a measure list","openapi":"/api-reference/openapi.yaml post /accounts/api/dashboard/views/from-preset","href":"/api-reference/dashboards/build-a-dashboard-from-a-measure-list-preset"},{"title":"Duplicate a dashboard view","deprecated":null,"version":null,"sidebarTitle":"Duplicate a dashboard view","openapi":"/api-reference/openapi.yaml post /accounts/api/dashboard/views/{dashboardViewId}/copy","href":"/api-reference/dashboards/duplicate-a-dashboard-view"},{"title":"Update a dashboard view","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml patch /accounts/api/dashboard/views/{dashboardViewId}","href":"/api-reference/dashboards/update-a-dashboard-view"},{"title":"Delete a dashboard view","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml delete /accounts/api/dashboard/views/{dashboardViewId}","href":"/api-reference/dashboards/delete-a-dashboard-view"}]},{"group":"COSTS","pages":[{"title":"Get cost configuration for COGS, shipping, and fees","deprecated":null,"version":null,"sidebarTitle":"Get cost configuration","openapi":"/api-reference/openapi.yaml get /accounts/api/costs","href":"/api-reference/costs/get-cost-configuration"},{"title":"Update the global product override","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml put /accounts/api/costs/global-product-override","href":"/api-reference/costs/update-the-global-product-override"},{"title":"Update shipping cost settings","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml put /accounts/api/costs/shipping-settings","href":"/api-reference/costs/update-shipping-cost-settings"},{"title":"Add a cost line","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /accounts/api/costs/lines","href":"/api-reference/costs/add-a-cost-line"},{"title":"Update an order, payment, shipping, or recurring cost line","deprecated":null,"version":null,"sidebarTitle":"Update a cost line","openapi":"/api-reference/openapi.yaml put /accounts/api/costs/lines/{lineId}","href":"/api-reference/costs/update-a-cost-line"},{"title":"Delete a cost line","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml delete /accounts/api/costs/lines/{lineId}","href":"/api-reference/costs/delete-a-cost-line"}]},{"group":"PRODUCTS","pages":[{"title":"Search products","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /accounts/api/products/search","href":"/api-reference/products/search-products"},{"title":"Get a product variant","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /accounts/api/products/{productId}/{variantId}/cost","href":"/api-reference/products/get-a-product-variant"},{"title":"Set a variant's handling fee","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml put /accounts/api/products/{productId}/{variantId}/handling-fee","href":"/api-reference/products/set-a-variants-handling-fee"},{"title":"Add a COGS line to a product variant","deprecated":null,"version":null,"sidebarTitle":"Add a COG line","openapi":"/api-reference/openapi.yaml post /accounts/api/products/{productId}/{variantId}/cogs","href":"/api-reference/products/add-a-cog-line-to-a-variant"},{"title":"Update a COGS line on a product variant","deprecated":null,"version":null,"sidebarTitle":"Update a COG line","openapi":"/api-reference/openapi.yaml put /accounts/api/products/{productId}/{variantId}/cogs/{cogId}","href":"/api-reference/products/update-a-cog-line"},{"title":"Delete a COGS line from a product variant","deprecated":null,"version":null,"sidebarTitle":"Delete a COG line","openapi":"/api-reference/openapi.yaml delete /accounts/api/products/{productId}/{variantId}/cogs/{cogId}","href":"/api-reference/products/delete-a-cog-line"}]},{"group":"EVENTS","pages":[{"title":"Send events via Upstack Conversion API","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /tr/api/events","href":"/api-reference/events/send-events-via-upstack-conversion-api"}]}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/install"}]}]},"basePath":"","title":"Run an attribution query by UTM source, campaign, or ad - Upstack Data","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CybtLBIt.js","utils-BMLj2fvV.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-B6In562Y.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dr8Mfhp9.js","snippetPresets-2rmQvMVl.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-WMqJYdZj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CJ-MlPHu.js","shallow-dY3TMRCk.js","getApiPlaygroundDisplay-v-1B2bKm.js","CodeSnippet-BDhiTB7U.js","CodeSnippets-D9hnzQcS.js","Page-C4GwDT3_.js","getPastedJson-Th2V45jI.js","icon-BQXch1W9.js","MethodPill-BCqUneP3.js","DuplicateIcon-Q_-bhurZ.js","createIcon-DUjLHRqp.js","DynamicMarkdown-B-f2cqXQ.js","SectionHeading-Da5NsV4v.js","axios-vUo_bRtp.js","Markdown-D13FWkIM.js","clsx-D3Isdib3.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-C-XZBk9h.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink--qIqmmVG.js"]}