← Back to Metrics

Tax Amount

Also known as: Tax, Order Tax, Tax Collected, Sales Tax Collected, Total Tax

MonetizationmetricE-commerce: Cart & Checkout Funnel AnalyticsE-commerce

Sum of the tax value carried on completed purchases in the reporting window, in reporting currency. Kept apart from revenue so AOV and GMV stay tax-exclusive; refunded tax is not netted here.

Business Use Case

1️⃣ Finance reconciles monthly Tax Amount to the order system's tax ledger and opens a tagging ticket if the gap tops 1%. 2️⃣ Finance reviews Tax Amount by delivery region after a new tax registration to confirm tax is being charged there. 3️⃣ Finance shows Tax Amount beside Revenue to reconcile tax-inclusive order totals with payment processor payouts.

Business Criticality

Medium

Journey / Navigation Area

Checkout

Owning Function

Finance

Scope

Event

Formula

SUM(tax) over purchase events, one row per distinct transaction_id, converted to reporting currency

Calculation Notes

1️⃣ Sum the purchase event's tax parameter once per transaction_id; repeat purchase hits from confirmation-page reloads are dropped. 2️⃣ Covers sales tax, VAT and GST charged at checkout; duties and import fees collected by the carrier on delivery are excluded. 3️⃣ Convert each order's tax to reporting currency at the order-date rate; never add amounts across currencies unconverted. 4️⃣ Refunded tax is not netted; it stays on the refund event's tax parameter and is subtracted only in a net-tax view. 5️⃣ A missing tax parameter counts as 0; GA4 sends no default, so taxable orders without it point to a tagging gap. 6️⃣ Exclude internal and test traffic (traffic_type = 'internal'). 7️⃣ Credited to the purchase event date; tax estimates shown in cart or at begin_checkout before address entry are not counted.

Technical Details

Measure TypeCurrency
Aggregation WindowDaily, Weekly, Monthly, Quarterly

Events

PlatformEvent
Google Analytics 4purchase
Adobepurchase

Data Mappings

W3 Data Layer
{
  "transaction": {
    "transactionID": "T-10293",
    "currency": "USD",
    "total": {
      "basePrice": 89.97,
      "taxAmount": 7.2,
      "shippingAmount": 5.99,
      "transactionTotal": 103.16
    }
  }
}
GA4 Data Layer
{
  "event": "purchase",
  "traffic_type": "external",
  "ecommerce": {
    "transaction_id": "T-10293",
    "value": 89.97,
    "tax": 7.2,
    "shipping": 5.99,
    "currency": "USD",
    "items": [
      {
        "item_id": "SKU_12345",
        "item_name": "Wireless Mouse",
        "price": 29.99,
        "quantity": 3
      }
    ]
  }
}
Adobe Client Data Layer
{
  "event": "purchase",
  "traffic_type": "external",
  "commerce": {
    "purchases": {
      "value": 1
    },
    "order": {
      "purchaseID": "T-10293",
      "priceTotal": 103.16,
      "currencyCode": "USD",
      "taxAmount": 7.2
    }
  },
  "productListItems": [
    {
      "SKU": "SKU_12345",
      "name": "Wireless Mouse",
      "priceTotal": 89.97,
      "quantity": 3
    }
  ]
}
XDM Mapping
{
  "commerce": {
    "order": {
      "purchaseID": "T-10293",
      "priceTotal": 103.16,
      "currencyCode": "USD",
      "taxAmount": 7.2
    },
    "purchases": {
      "value": 1
    }
  },
  "_tenant": {
    "traffic_type": "external"
  }
}

SQL Queries

Google Analytics 4 (BigQuery)
-- ==========================================
-- 1. GOOGLE BIGQUERY SQL
-- ==========================================
DECLARE start_date DATE DEFAULT DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY);
DECLARE end_date DATE DEFAULT DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY);

-- Purchase events in the window with checkout tax in USD (GA4 converts at the order-date rate); missing tax counts as 0
WITH purchases AS (
  SELECT
    ecommerce.transaction_id AS transaction_id,
    event_timestamp,
    COALESCE(ecommerce.tax_value_in_usd, 0) AS tax_usd,
    (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'traffic_type') AS traffic_type
  FROM `your-project.analytics_123456789.events_*`
  WHERE _TABLE_SUFFIX BETWEEN FORMAT_DATE('%Y%m%d', start_date) AND FORMAT_DATE('%Y%m%d', end_date)
    AND event_name = 'purchase'
    AND ecommerce.transaction_id IS NOT NULL
),
-- Exclude internal traffic and keep the first purchase hit per transaction_id (drops confirmation-page reloads)
deduped AS (
  SELECT
    tax_usd,
    ROW_NUMBER() OVER (PARTITION BY transaction_id ORDER BY event_timestamp) AS rn
  FROM purchases
  WHERE COALESCE(traffic_type, '') != 'internal'
)
-- Tax Amount: sum of tax once per transaction
SELECT ROUND(SUM(tax_usd), 2) AS tax_amount_usd
FROM deduped
WHERE rn = 1;
Adobe Experience Platform (AEP Query Service)
-- ==========================================
-- 2. ADOBE AEP QUERY SERVICE SQL
-- ==========================================
-- Relative reporting window (last 90 complete days)
WITH params AS (
  SELECT DATE_SUB(CURRENT_DATE(), 90) AS start_date, DATE_SUB(CURRENT_DATE(), 1) AS end_date
),
-- Purchase events in the window with the checkout tax in order currency; missing tax counts as 0
purchases AS (
  SELECT
    e.commerce.order.purchaseID AS transaction_id,
    e.commerce.order.currencyCode AS currency_code,
    e.timestamp AS event_ts,
    COALESCE(e.commerce.order.taxAmount, 0) AS tax_local,
    e._tenant.traffic_type AS traffic_type
  FROM aep_web_events_dataset e
  CROSS JOIN params p
  WHERE e.commerce.purchases.value > 0
    AND e.commerce.order.purchaseID IS NOT NULL
    AND CAST(e.timestamp AS DATE) BETWEEN p.start_date AND p.end_date
),
-- Exclude internal traffic and keep the first purchase hit per transaction_id (drops confirmation-page reloads)
deduped AS (
  SELECT
    transaction_id,
    currency_code,
    event_ts,
    tax_local,
    ROW_NUMBER() OVER (PARTITION BY transaction_id ORDER BY event_ts) AS rn
  FROM purchases
  WHERE COALESCE(traffic_type, '') != 'internal'
)
-- Tax Amount: sum of tax once per transaction, converted to USD at the order-date rate (rate 1 for USD orders; LEFT JOIN keeps every order)
SELECT ROUND(SUM(d.tax_local * CASE WHEN d.currency_code = 'USD' THEN 1 ELSE fx.usd_rate END), 2) AS tax_amount_usd
FROM deduped d
LEFT JOIN fx_rates_dataset fx
  ON fx.currency_code = d.currency_code
 AND fx.rate_date = CAST(d.event_ts AS DATE)
WHERE d.rn = 1;

Source Data

Digital Analytics (GA4)

Dependencies

Prerequisite: List the dependencies required for this Metric

Events:

purchase

Dimensions:

transaction-idcurrency

Report Attributes

Currency Delivery Region Fulfillment Method Payment Method Device Category

Recommended Reporting Views

Views
Checkout & Order PerformanceFinance Revenue Reconciliation

Segment Eligibility

true

Governance

Data SensitivityInternal

Governance

Created bydevyendarm
Created on9/26/2026
Last modified bydevyendarm
Last modified on9/26/2026
Version1.0.0
Validation stateqa passed
StatusPUBLISHED

GitHub

View related Pull Requestcatalog/metrics/tax-amount.yml

Community Discussion