← Back to KPIs

Orders

Indicates the number purchases or transactions successfully completed an individual customer or all customers during a selected time period.

Business Use Case

1️⃣ Marketing Attribution & ROI: Identify which campaigns actually drive orders & revenue versus those that just drive "window shopping" (traffic) 2️⃣ Inventory & Supply Chain Management: Order volume over time allows businesses to predict future demand and avoid "Stockouts" or overstocking 3️⃣ Customer Loyalty & Retention Analysis: 4️⃣ Product Performance: identify high-interest items that convert or failed to convert due to price, reviews, or poor descriptions etc., 5️⃣ Product Finding Methods: Analyze which site features like internal search, category menus, or recommendation widgets are most effective at leading users to a final purchase.

Importance of KPI

High

Core area of KPI Analysis

Digital analytics, Business intelligence

Scope at which KPI is analyzed

Global

Formula

Orders = COUNT(DISTINCT order_id)

SQL Query

SELECT COUNT(DISTINCT order_id) AS total_orders, DATE(event_timestamp) AS order_date
FROM ecommerce_events
WHERE event_name = 'purchase'
GROUP BY order_date
ORDER BY order_date;

Calculation Notes

1️⃣ Filter duplicate transactions by unique order_id. 2️⃣ Exclude test or internal transactions via predefined filters. 3️⃣ Consider refunds or cancellations as adjustments in Orders and downstream Revenue KPIs to report actual business impacting metrics.

Technical Details

Measure TypeCounter
Aggregation WindowSession, User, Time based - Hourly/Daily/Monthly/Yearly

Events

PlatformEvent
Google Analytics 4purchase
Adobepurchase

Data Mappings

W3 Data Layer
window.digitalData = {
  page: {
    pageInfo: {
      pageName: "Order Confirmation",
      destinationURL: window.location.href
    },
    category: {
      primaryCategory: "Ecommerce",
      pageType: "Purchase Confirmation"
    }
  },
  transaction: {
    transactionID: "T_12345_1",
    total: {
      basePrice: 30.03,
      taxAmount: 4.90,
      shipping: 5.99,
      currency: "USD"
    },
    voucherCode: "SUMMER_SALE",
    item: [{
      productInfo: {
        productName: "Stan and Friends Tee",
        sku: "SKU_12345",
        manufacturer: "Google"
      },
      category: {
        primaryCategory: "Apparel",
        subCategory1: "Adult",
        subCategory2: "Shirts"
      },
      quantity: 3,
      price: {
        basePrice: 10.01,
        currency: "USD"
      },
      attributes: {
        variant: "green",
        coupon: "SUMMER_FUN",
        discount: 2.22
      }
    }]
  },
  event: [{
    eventInfo: {
      eventName: "Purchase",
      eventType: "transaction",
      eventAction: "purchase-complete"
    }
  }]
};
GA4 Data Layer
{
        transaction_id: "T_12345_1",
        value: 30.03,
        tax: 4.90,
        shipping: 5.99,
        currency: "USD",
        coupon: "SUMMER_SALE",
        items: [
        // If someone purchases more than one item,
        // you can add those items to the items array
         {
          item_id: "SKU_12345",
          item_name: "Stan and Friends Tee",
          affiliation: "Google Merchandise Store",
          coupon: "SUMMER_FUN",
          discount: 2.22,
          index: 0,
          item_brand: "Google",
          item_category: "Apparel",
          item_category2: "Adult",
          item_category3: "Shirts",
          item_category4: "Crew",
          item_category5: "Short sleeve",
          item_list_id: "related_products",
          item_list_name: "Related Products",
          item_variant: "green",
          location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
          price: 10.01,
          quantity: 3
        }]
    }
XDM Mapping
/*In a practical setup, it is a practice to XDM-formatted object into the Adobe Client Data Layer to have the benefit of both.

window.adobeDataLayer.push({
  "event": "order-complete",
  "xdm": {
    // The XDM block from above goes here
  }
});
*/

{
  "xdm": {
    "eventType": "commerce.purchases",
    "commerce": {
      "order": {
        "purchaseID": "T_12345_1",
        "currencyCode": "USD",
        "priceTotal": 30.03,
        "taxAmount": 4.90,
        "shippingAmount": 5.99,
        "purchaseReferralCode": "SUMMER_SALE"
      },
      "purchases": {
        "value": 1
      }
    },
    "productListItems": [
      {
        "SKU": "SKU_12345",
        "name": "Stan and Friends Tee",
        "quantity": 3,
        "priceTotal": 30.03,
        "product": "SKU_12345"
      }
    ]
  }
}

Source Data

Digital analytics, Business intelligence

Dependencies

Prerequisite: List the dependencies required for this KPI

Events:

purchase

Report Attributes

Order ID, Transaction Date, Revenue, Items Purchased, Campaign, Product category

Dashboard Usage

Dashboards
Product Performance, Sales/E-commerce Dashboard, Key Metrics

Segment Eligibility

True

Governance

Data SensitivityInternal

Governance

Created bydevyendarm
Created on11/30/2025
Last modified bydevyendarm
Last modified on2/26/2026
StatusPUBLISHED

GitHub

View related Pull Requestdata-layer/kpis/orders.yml

Community Discussion