Skip to main content
  • Label: Sales
  • Description: Order-level metrics from order data.
  • Default group key: transaction_id

Metrics

  • total_sales (USD)
    • Gross sales across every imported order, with no attribution applied. This covers the whole store, not just the part Layers influenced. Measures line-item price after line-item discounts, in the store’s own currency: before tax and shipping, and not reduced by refunds or cancellations.
    • Example: SUM(total_sales)
  • quantity_purchased (items)
    • Number of items purchased.
    • Example: SUM(quantity_purchased)
  • orders (orders)
    • Unique orders (transaction_id).
    • Example: COUNT_DISTINCT(orders)
  • line_items (items)
    • Unique line items purchased.
    • Example: COUNT_DISTINCT(line_items)
  • customers (customers)
    • Unique customers who purchased.
    • Example: COUNT_DISTINCT(customers)

Dimensions

  • transaction_id: Shopify order ID.
  • line_item_id: Shopify line item ID.
  • product_id: Shopify product ID.
  • variant_id: Shopify variant ID.
  • variant_sale_status: Each variant’s current sale status, on_sale or full_price. A variant is on_sale when its compare-at price is higher than its price at your store’s base catalog price. Market-specific prices aren’t considered. This is the variant’s status today, not when the activity happened: once a variant goes on sale, its earlier full-price activity also counts as on_sale. Layers refreshes the status nightly and whenever you save a metric that uses it. Variants of products that aren’t published to your online store, and rows with no variant, count as full_price. Only metrics that record a variant can use this dimension. See Sale status.
  • customer_id: Shopify customer ID.
  • session_id: Session identifier derived from the order.
  • geo_country: Country from the shipping address.
  • geo_state: State or province from the shipping address.
  • geo_city: City from the shipping address.
  • shopping_channel: Channel of purchase (web, app, or retail). Resolves to retail whenever the order has a retail_location_id; otherwise reports the raw channel from the originating request.
  • retail_location_id: Retail location ID for the purchase. NULL on non-retail orders. Use retail_location_id IS NULL to exclude retail orders, or filter by a specific ID to scope to one store.
  • locale: Storefront locale code active on the originating request (e.g., en, fr, pt-br).
  • currency: ISO 4217 currency code of the originating request (e.g., USD, EUR).
  • session_returning: Session type at the time of the originating request — new or returning.
  • customer_state: Whether the shopper was authenticated at purchase — signed_in or guest.
  • customer_returning: Each order is new or returning based on its place in the customer’s retained purchase history. Guest orders are new. The default history window is 730 days.
  • b2b_company: Shopify B2B company location identifier for the signed-in company account.
  • marketing_source: UTM source.
  • marketing_medium: UTM medium.
  • marketing_campaign: UTM campaign.
  • device: Device category derived from User-Agent.
  • browser: Browser family from User-Agent.

Product attributes

Use product_attributes.* to group or filter sales by your catalog’s product attributes, for example product_attributes.color. Grouping by an attribute returns one row per attribute value, with sales from products that have no value for the attribute in a separate NULL row. The Products dataset explains filtering and what happens the first time a query uses an attribute.

Examples

Total revenue by country (last 30 days)
Order count by marketing source (this month)
Customer count by shopping channel (past 90 days)
Retail orders only (last 7 days)
Online orders only, excluding retail (last 7 days)
Revenue by product color (past 30 days)

Next steps