Skip to main content

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.


Counts and calculations that let you track key business indicators. Metrics show up as the columns when queried.

Metrics you can use when querying FROM campaign_sales.

Anchor to campaign_first_click_order_count
campaign_first_click_order_count

Count of orders for the first cross-device attribution model

Anchor to campaign_first_click_total_average_order_value
campaign_first_click_total_average_order_value

Total average order value for the first click cross-device attribution model

Anchor to campaign_first_click_total_sales
campaign_first_click_total_sales

Total sales for the first cross-device attribution model

Anchor to campaign_last_click_order_count
campaign_last_click_order_count

The number of orders credited by last click attribution to the final marketing touchpoint before purchase.

Anchor to campaign_last_click_total_average_order_value
campaign_last_click_total_average_order_value

Total average order value for the last click attribution model

Anchor to campaign_last_click_total_sales
campaign_last_click_total_sales

Total sales for the last click attribution model

Anchor to campaign_last_non_direct_click_order_count
campaign_last_non_direct_click_order_count

Count of orders for the last non-direct click cross-device attribution model

Anchor to campaign_last_non_direct_click_total_average_order_value
campaign_last_non_direct_click_total_average_order_value

Total average order value for the last non-direct click cross-device attribution model

Anchor to campaign_last_non_direct_click_total_sales
campaign_last_non_direct_click_total_sales

Total sales for the last non-direct cross-device attribution model

Anchor to campaign_linear_order_count
campaign_linear_order_count

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_value
campaign_linear_total_average_order_value

Total average order value using the linear cross-device attribution model

Anchor to campaign_linear_total_sales
campaign_linear_total_sales

Total sales using the linear cross-device attribution model

Anchor to campaign_first_click_average_order_value
campaign_first_click_average_order_value

Average order value for the first click cross-device attribution model

First click average order value = (gross sales - discounts) / orders

Deprecated

Deprecated since 2026-07. Replaced by campaign_first_click_total_average_order_value

Anchor to campaign_first_click_sales
campaign_first_click_sales

Sales for the first cross-device attribution model

First click sales = gross sales - discounts

Deprecated

Deprecated since 2026-07. Replaced by campaign_first_click_total_sales

Anchor to campaign_last_click_average_order_value
campaign_last_click_average_order_value

Average order value for the last click attribution model

Last click average order value = (gross sales - discounts) / orders

Deprecated

Deprecated since 2026-07. Replaced by campaign_last_click_total_average_order_value

Anchor to campaign_last_click_sales
campaign_last_click_sales

Sales for the last click attribution model

Last click sales = gross sales - discounts

Deprecated

Deprecated since 2026-07. Replaced by campaign_last_click_total_sales

Anchor to campaign_last_non_direct_click_average_order_value
campaign_last_non_direct_click_average_order_value

Average order value for the last non-direct click cross-device attribution model

Last non-direct click average order value = (gross sales - discounts) / orders

Deprecated

Deprecated since 2026-07. Replaced by campaign_last_non_direct_click_total_average_order_value

Anchor to campaign_last_non_direct_click_sales
campaign_last_non_direct_click_sales

Sales for the last non-direct cross-device attribution model

Last non-direct click sales = gross sales - discounts

Deprecated

Deprecated since 2026-07. Replaced by campaign_last_non_direct_click_total_sales

Anchor to campaign_linear_average_order_value
campaign_linear_average_order_value

Average order value using the linear cross-device attribution model

Linear average order value = (gross sales - discounts) / orders

Deprecated

Deprecated since 2026-07. Replaced by campaign_linear_total_average_order_value

Anchor to campaign_linear_sales
campaign_linear_sales

Sales using the linear cross-device attribution model

Linear sales = gross sales - discounts

Deprecated

Deprecated since 2026-07. Replaced by campaign_linear_total_sales


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 FROM campaign_sales.

Anchor to campaign_id
campaign_id

The campaign identifier tied to the session that led to the order.

Anchor to click_id_tag
click_id_tag

The tracking tag associated with the click ID for the campaign-driven session.

Anchor to customer_id
customer_id

The unique Shopify identifier for the customer on the order.

Anchor to customer_repeat_order
customer_repeat_order

Indicates if this is a repeat order from the customer

The day an order from a campaign-driven session was processed.

Anchor to day_of_week
day_of_week

The day of the week an order from a campaign-driven session was processed, with values Monday through Sunday.

The hour an order from a campaign-driven session was processed.

Anchor to hour_of_day
hour_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_device
is_first_cross_device

Indicates if this is the first session in the customer journey across devices

Anchor to is_last
is_last

Indicates if this is the last session in the customer journey

Anchor to is_last_non_direct_cross_device
is_last_non_direct_cross_device

Indicates if this is the last non-direct session in the customer journey across devices

Anchor to linear_model_attribution_weight_cross_device
linear_model_attribution_weight_cross_device

The share of order credit assigned to the campaign-driven session by the linear cross-device model.

Anchor to marketing_activity_url_parameter_key
marketing_activity_url_parameter_key

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_value
marketing_activity_url_parameter_value

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_id
marketing_event_api_client_id

Identifier for the API client of the Marketing Event associated with the session

Anchor to marketing_event_id
marketing_event_id

The marketing event identifier associated with the session that led to the order.

Anchor to month
month

The month an order from a campaign-driven session was processed.

Anchor to month_of_year
month_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_customer
new_or_returning_customer

Whether an order came from the customer's first purchase (New) or a later purchase (Returning).

Anchor to normalized_page_url
normalized_page_url

The page URL for the session, with query parameters and fragments removed so the same page groups together. Use normalized_page_url to see which pages led to campaign-driven sales.

Anchor to order_id
order_id

The unique Shopify identifier for the order. Use order_id with order_name to show readable order labels.

Anchor to order_name
order_name

Name of the order

Anchor to order_processed_at
order_processed_at

The exact date and time the order was processed, reported in your store's time zone.

Anchor to quarter
quarter

The quarter an order from a campaign-driven session was processed.

Anchor to referrer_url
referrer_url

The referring page that brought the visitor to your store. The same page groups together regardless of tracking parameters.

Anchor to referring_channel
referring_channel

Channel that led to an online store session

Anchor to referring_medium
referring_medium

Category of referring channel that led to an online store session

Anchor to referring_platform
referring_platform

Platform that led to an online store session

Anchor to sa_token
sa_token

The session token tied to campaign attribution for the order.

Anchor to shop_id
shop_id

The unique Shopify identifier for your store. Use shop_id with shop_name to show readable store labels.

Anchor to traffic_type
traffic_type

The type of traffic that led to the online store session, such as Direct, Paid, Organic, or Unattributed.

Anchor to utm_campaign
utm_campaign

The campaign name from the UTM tracking on the session. Values are free text from your campaign links.

Anchor to utm_content
utm_content

UTM content associated with the session

Anchor to utm_medium
utm_medium

The medium value from the UTM tracking on the session. Values are free text from your campaign links.

Anchor to utm_source
utm_source

The source value from the UTM tracking on the session. Values are free text from your campaign links.

Anchor to utm_term
utm_term

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.

The week an order from a campaign-driven session was processed.

Anchor to week_of_year
week_of_year

The week of year an order from a campaign-driven session was processed, with values 1 through 53.

The year an order from a campaign-driven session was processed.

Anchor to customer_amount_spent
customer_amount_spent

The customer's all-time spend is shown in your store's currency.

Anchor to customer_last_order_date
customer_last_order_date

The day the customer most recently placed an order, reported in your store's time zone.

Anchor to customer_number_of_orders
customer_number_of_orders

Number of orders the customer has placed across all time

Anchor to shop_name
shop_name

Name of your store

Anchor to customer_first_order
customer_first_order

Indicates if this is the customer's first order

Deprecated

Deprecated since 2026-04. Field removed from data source

Anchor to marketing_event_type
marketing_event_type

Type of the marketing event

Deprecated

Deprecated since 2026-04. Field removed from data source


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

Was this page helpful?