campaign_ sales
The campaign_sales schema captures order-level sales and customer outcomes attributed to marketing campaigns. It supports campaign order reporting across attribution models and traffic-source dimensions.
Anchor to Use casesUse cases
- Attribution models: Compare
campaign_first_click_order_count,campaign_last_click_order_count, andcampaign_linear_order_countfor each campaign to see how the attribution model you pick shifts the orders credited to it. - UTM breakdown: Group
campaign_last_non_direct_click_order_countbyutm_campaign,utm_source, orutm_mediumto see which sources and mediums drive attributed orders. - Customer type: Split
campaign_last_click_order_countbynew_or_returning_customerorcustomer_repeat_orderto see whether a campaign wins new customers or repeat buyers. - Traffic source: Use
referring_channel,referring_platform, andtraffic_typeto classify campaign-attributed orders by traffic source.
Anchor to MetricsMetrics
Counts and calculations that let you track key business indicators. Metrics show up as the columns when queried.
Metrics you can use when querying .
- Anchor to campaign_first_click_order_countcampaign_
first_ click_ order_ countcampaign_ first_ click_ order_ count INTEGERINTEGER Count of orders for the first cross-device attribution model
- Anchor to campaign_first_click_total_average_order_valuecampaign_
first_ click_ total_ average_ order_ valuecampaign_ first_ click_ total_ average_ order_ value MONEYMONEY Total average order value for the first click cross-device attribution model
- Anchor to campaign_first_click_total_salescampaign_
first_ click_ total_ salescampaign_ first_ click_ total_ sales MONEYMONEY Total sales for the first cross-device attribution model
- Anchor to campaign_last_click_order_countcampaign_
last_ click_ order_ countcampaign_ last_ click_ order_ count INTEGERINTEGER The number of orders credited by last click attribution to the final marketing touchpoint before purchase.
- Anchor to campaign_last_click_total_average_order_valuecampaign_
last_ click_ total_ average_ order_ valuecampaign_ last_ click_ total_ average_ order_ value MONEYMONEY Total average order value for the last click attribution model
- Anchor to campaign_last_click_total_salescampaign_
last_ click_ total_ salescampaign_ last_ click_ total_ sales MONEYMONEY Total sales for the last click attribution model
- Anchor to campaign_last_non_direct_click_order_countcampaign_
last_ non_ direct_ click_ order_ countcampaign_ last_ non_ direct_ click_ order_ count INTEGERINTEGER Count of orders for the last non-direct click cross-device attribution model
- Anchor to campaign_last_non_direct_click_total_average_order_valuecampaign_
last_ non_ direct_ click_ total_ average_ order_ valuecampaign_ last_ non_ direct_ click_ total_ average_ order_ value MONEYMONEY Total average order value for the last non-direct click cross-device attribution model
- Anchor to campaign_last_non_direct_click_total_salescampaign_
last_ non_ direct_ click_ total_ salescampaign_ last_ non_ direct_ click_ total_ sales MONEYMONEY Total sales for the last non-direct cross-device attribution model
- Anchor to campaign_linear_order_countcampaign_
linear_ order_ countcampaign_ linear_ order_ count DECIMALDECIMAL The weighted number of orders under linear cross-device attribution. Values can include fractional order credit because linear attribution shares credit across campaign sessions.
- Anchor to campaign_linear_total_average_order_valuecampaign_
linear_ total_ average_ order_ valuecampaign_ linear_ total_ average_ order_ value MONEYMONEY Total average order value using the linear cross-device attribution model
- Anchor to campaign_linear_total_salescampaign_
linear_ total_ salescampaign_ linear_ total_ sales MONEYMONEY Total sales using the linear cross-device attribution model
- Anchor to campaign_first_click_average_order_valuecampaign_
first_ click_ average_ order_ valuecampaign_ first_ click_ average_ order_ value MONEYMONEYdeprecateddeprecated Average order value for the first click cross-device attribution model
First click average order value = (gross sales - discounts) / orders- Anchor to campaign_first_click_salescampaign_
first_ click_ salescampaign_ first_ click_ sales MONEYMONEYdeprecateddeprecated Sales for the first cross-device attribution model
First click sales = gross sales - discounts- Anchor to campaign_last_click_average_order_valuecampaign_
last_ click_ average_ order_ valuecampaign_ last_ click_ average_ order_ value MONEYMONEYdeprecateddeprecated Average order value for the last click attribution model
Last click average order value = (gross sales - discounts) / orders- Anchor to campaign_last_click_salescampaign_
last_ click_ salescampaign_ last_ click_ sales MONEYMONEYdeprecateddeprecated Sales for the last click attribution model
Last click sales = gross sales - discounts- Anchor to campaign_last_non_direct_click_average_order_valuecampaign_
last_ non_ direct_ click_ average_ order_ valuecampaign_ last_ non_ direct_ click_ average_ order_ value MONEYMONEYdeprecateddeprecated Average order value for the last non-direct click cross-device attribution model
Last non-direct click average order value = (gross sales - discounts) / orders- Anchor to campaign_last_non_direct_click_salescampaign_
last_ non_ direct_ click_ salescampaign_ last_ non_ direct_ click_ sales MONEYMONEYdeprecateddeprecated Sales for the last non-direct cross-device attribution model
Last non-direct click sales = gross sales - discounts- Anchor to campaign_linear_average_order_valuecampaign_
linear_ average_ order_ valuecampaign_ linear_ average_ order_ value MONEYMONEYdeprecateddeprecated Average order value using the linear cross-device attribution model
Linear average order value = (gross sales - discounts) / orders- Anchor to campaign_linear_salescampaign_
linear_ salescampaign_ linear_ sales MONEYMONEYdeprecateddeprecated Sales using the linear cross-device attribution model
Linear sales = gross sales - discounts
MONEY
A monetary amount representing currency values such as prices, revenue, costs, and discounts.
INTEGER
A whole number without decimal places, used for counts, quantities, and other discrete numeric values.
DECIMAL
A precise decimal number used for calculations where fixed-point precision matters.
Anchor to DimensionsDimensions
Attributes of your data that let you look more granularly at aspects of the data. Group and filter by dimensions to shape the rows your query returns.
Dimensions you can use when querying .
- Anchor to campaign_idcampaign_
idcampaign_ id IDENTITYIDENTITY The campaign identifier tied to the session that led to the order.
- Anchor to click_id_tagclick_
id_ tagclick_ id_ tag STRINGSTRING The tracking tag associated with the click ID for the campaign-driven session.
- Anchor to customer_idcustomer_
idcustomer_ id IDENTITYIDENTITY The unique Shopify identifier for the customer on the order.
- Anchor to customer_repeat_ordercustomer_
repeat_ ordercustomer_ repeat_ order BOOLEANBOOLEAN Indicates if this is a repeat order from the customer
- Anchor to daydaydayDAY_TIMESTAMPDAY_TIMESTAMP
The day an order from a campaign-driven session was processed.
- Anchor to day_of_weekday_
of_ weekday_ of_ week DAY_OF_WEEKDAY_OF_WEEK The day of the week an order from a campaign-driven session was processed, with values Monday through Sunday.
- Anchor to hourhourhourHOUR_TIMESTAMPHOUR_TIMESTAMP
The hour an order from a campaign-driven session was processed.
- Anchor to hour_of_dayhour_
of_ dayhour_ of_ day HOUR_OF_DAYHOUR_OF_DAY The hour of day an order from a campaign-driven session was processed, with values 0 through 23.
- Anchor to is_first_cross_deviceis_
first_ cross_ deviceis_ first_ cross_ device BOOLEANBOOLEAN Indicates if this is the first session in the customer journey across devices
- Anchor to is_lastis_
lastis_ last BOOLEANBOOLEAN Indicates if this is the last session in the customer journey
- Anchor to is_last_non_direct_cross_deviceis_
last_ non_ direct_ cross_ deviceis_ last_ non_ direct_ cross_ device BOOLEANBOOLEAN Indicates if this is the last non-direct session in the customer journey across devices
- Anchor to linear_model_attribution_weight_cross_devicelinear_
model_ attribution_ weight_ cross_ devicelinear_ model_ attribution_ weight_ cross_ device DECIMALDECIMAL The share of order credit assigned to the campaign-driven session by the linear cross-device model.
- Anchor to marketing_activity_url_parameter_keymarketing_
activity_ url_ parameter_ keymarketing_ activity_ url_ parameter_ key STRINGSTRING The URL parameter name tied to the marketing activity for the session. Values are free-text parameter keys from your campaign links.
- Anchor to marketing_activity_url_parameter_valuemarketing_
activity_ url_ parameter_ valuemarketing_ activity_ url_ parameter_ value STRINGSTRING The URL parameter value tied to the marketing activity for the session. Values are free text from your campaign links.
- Anchor to marketing_event_api_client_idmarketing_
event_ api_ client_ idmarketing_ event_ api_ client_ id IDENTITYIDENTITY Identifier for the API client of the Marketing Event associated with the session
- Anchor to marketing_event_idmarketing_
event_ idmarketing_ event_ id IDENTITYIDENTITY The marketing event identifier associated with the session that led to the order.
- Anchor to monthmonthmonthMONTH_TIMESTAMPMONTH_TIMESTAMP
The month an order from a campaign-driven session was processed.
- Anchor to month_of_yearmonth_
of_ yearmonth_ of_ year MONTH_OF_YEARMONTH_OF_YEAR The month of year an order from a campaign-driven session was processed, with values 1 through 12.
- Anchor to new_or_returning_customernew_
or_ returning_ customernew_ or_ returning_ customer STRINGSTRING Whether an order came from the customer's first purchase (New) or a later purchase (Returning).
- Anchor to normalized_page_urlnormalized_
page_ urlnormalized_ page_ url STRINGSTRING - Anchor to order_idorder_
idorder_ id IDENTITYIDENTITY - Anchor to order_nameorder_
nameorder_ name STRINGSTRING Name of the order
- Anchor to order_processed_atorder_
processed_ atorder_ processed_ at TIMESTAMPTIMESTAMP The exact date and time the order was processed, reported in your store's time zone.
- Anchor to quarterquarterquarterQUARTER_TIMESTAMPQUARTER_TIMESTAMP
The quarter an order from a campaign-driven session was processed.
- Anchor to referrer_urlreferrer_
urlreferrer_ url STRINGSTRING The referring page that brought the visitor to your store. The same page groups together regardless of tracking parameters.
- Anchor to referring_channelreferring_
channelreferring_ channel STRINGSTRING Channel that led to an online store session
- Anchor to referring_mediumreferring_
mediumreferring_ medium STRINGSTRING Category of referring channel that led to an online store session
- Anchor to referring_platformreferring_
platformreferring_ platform STRINGSTRING Platform that led to an online store session
- Anchor to sa_tokensa_
tokensa_ token STRINGSTRING The session token tied to campaign attribution for the order.
- Anchor to shop_idshop_
idshop_ id IDENTITYIDENTITY - Anchor to traffic_typetraffic_
typetraffic_ type STRINGSTRING The type of traffic that led to the online store session, such as Direct, Paid, Organic, or Unattributed.
- Anchor to utm_campaignutm_
campaignutm_ campaign STRINGSTRING The campaign name from the UTM tracking on the session. Values are free text from your campaign links.
- Anchor to utm_contentutm_
contentutm_ content STRINGSTRING UTM content associated with the session
- Anchor to utm_mediumutm_
mediumutm_ medium STRINGSTRING The medium value from the UTM tracking on the session. Values are free text from your campaign links.
- Anchor to utm_sourceutm_
sourceutm_ source STRINGSTRING The source value from the UTM tracking on the session. Values are free text from your campaign links.
- Anchor to utm_termutm_
termutm_ term STRINGSTRING The term value from the UTM tracking on the session. Values are free text from your campaign links, often used for keywords or search terms.
- Anchor to weekweekweekWEEK_TIMESTAMPWEEK_TIMESTAMP
The week an order from a campaign-driven session was processed.
- Anchor to week_of_yearweek_
of_ yearweek_ of_ year WEEK_OF_YEARWEEK_OF_YEAR The week of year an order from a campaign-driven session was processed, with values 1 through 53.
- Anchor to yearyearyearYEAR_TIMESTAMPYEAR_TIMESTAMP
The year an order from a campaign-driven session was processed.
- Anchor to customer_amount_spentcustomer_
amount_ spentcustomer_ amount_ spent MONEYMONEY The customer's all-time spend is shown in your store's currency.
- Anchor to customer_last_order_datecustomer_
last_ order_ datecustomer_ last_ order_ date DAY_TIMESTAMPDAY_TIMESTAMP The day the customer most recently placed an order, reported in your store's time zone.
- Anchor to customer_number_of_orderscustomer_
number_ of_ orderscustomer_ number_ of_ orders INTEGERINTEGER Number of orders the customer has placed across all time
- Anchor to shop_nameshop_
nameshop_ name STRINGSTRING Name of your store
- Anchor to customer_first_ordercustomer_
first_ ordercustomer_ first_ order BOOLEANBOOLEANdeprecateddeprecated Indicates if this is the customer's first order
DeprecatedDeprecated since
2026-04. Field removed from data sourceDeprecated:Deprecated since
2026-04. Field removed from data source- Anchor to marketing_event_typemarketing_
event_ typemarketing_ event_ type STRINGSTRINGdeprecateddeprecated Type of the marketing event
DeprecatedDeprecated since
2026-04. Field removed from data sourceDeprecated:Deprecated since
2026-04. Field removed from data source
IDENTITY
A unique identifier for a Shopify resource such as a customer, product, or order.
STRING
A sequence of characters representing text data.
BOOLEAN
A true or false value representing binary states.
DAY_TIMESTAMP
A date value truncated to day precision.
DAY_OF_WEEK
A day within a week, used for weekday-based grouping and filtering.
HOUR_TIMESTAMP
A timestamp truncated to hour precision.
HOUR_OF_DAY
An hour within a day, typically represented as an integer from 0 to 23.
MONTH_TIMESTAMP
A date value representing the start of a month.
MONTH_OF_YEAR
A month number within a year.
TIMESTAMP
A full-precision timestamp including date and time.
QUARTER_TIMESTAMP
A date value representing the start of a fiscal quarter.
WEEK_TIMESTAMP
A date value representing the start of a week.
WEEK_OF_YEAR
A week number within a year.
YEAR_TIMESTAMP
A date value representing the start of a year.
campaign_products: Product-level attribution for the same campaigns when you want unit volume per product.campaign_sessions: Session-level funnel signals from the same campaigns.marketing_engagements: App-level engagement and ad spend metrics paired with attributed sales.