# Classes and causes

How to find the cause behind each class from step 6. Each cause lists how to detect it in the worksheet output, the evidence that proves it, and where the fix belongs. Query numbers refer to [../assets/ga4-bigquery-worksheet.sql](../assets/ga4-bigquery-worksheet.sql); the order-side classification ([../assets/classify-on-order-side.sql](../assets/classify-on-order-side.sql)) returns the same columns.

Work in this order: analytics-only and duplicates first (they hide misses in totals), then missing, then value, then late. Prove one cause on named orders before generalising it to a segment.

## Missing in analytics

The order is eligible and no purchase row with its key exists in the scan window.

- Consent denied under basic consent mode.
  - Under basic mode Google tags are blocked until consent, so a denied visitor's purchase never reaches GA4. Under advanced mode tags send cookieless pings while consent is denied, and Google states these pings are present in the BigQuery export (checked 2026-10-17). In the export, a denied purchase under advanced mode is not missing; look for another cause.
  - With the Data API fallback, advanced mode does not help: Google states reports include only consented data unless behavioural modelling is active under the Blended reporting identity (checked 2026-10-17). Count denied orders in `X` from consent evidence, as under basic mode, and do not expect them as joinable transaction IDs.
  - Detect: the control segment's miss rate (Query 7) sits close to the denial rate for checkout sessions in the same regions and period.
  - Evidence: CMP logs or per-order consent stored with the order. Without them, report the share as unexplained, never as consent.
  - Fix: none if the policy is working. If defaults or updates misfire, hand to consent-debugging.
- Blockers and tracking prevention.
  - Extensions, privacy browsers and network filters block the tag or the collection request. GA4 cannot show it, because blocked requests leave no row.
  - Detect: misses spread across payment methods and flows with no suspect segment against the control, often heavier on desktop.
  - Measure (step 7b), either way counts in `X`:
    - Order level: join a first-party record of confirmation-page loads (server access log or your own beacon) to orders with no GA4 row. Each match is a measured blocker loss.
    - Rate level: once checkout captures `client_id` ([browser-vs-server.md](browser-vs-server.md)), the share of consented checkouts with no `client_id` captured is the blocker rate. Apply it like a consent rate, capped at the missing count, and say it is an estimate.
  - Fix: count it as expected non-collection for a browser architecture once measured. Server-confirmed sending recovers it in counts only when the contract sends orders without a captured `client_id` with a generated ID; it never recovers their attribution.
- Legacy checkout scripts stopped after the Shopify checkout upgrade.
  - Additional scripts became view-only on 2025-08-28. Order status page script tags stopped running on 2025-08-28 for Plus stores and on 2026-08-26 for all other stores, and non-Plus stores still on the legacy Thank you and Order status pages were due to upgrade by 2026-08-26 (checked 2026-10-17). Purchase tracking left in Additional scripts or a script tag stopped firing at the upgrade.
  - Detect: a step change in the matched-order rate at the upgrade date under the same contract; re-run the previous period for comparison.
  - Evidence: the upgrade state under Settings, Checkout, Configurations (verify the path live); a script still visible but view-only; and the current purchase owner named (a sales channel app, an app pixel or a custom pixel).
  - Fix: move the purchase to an app or custom pixel (Shopify's replacement for analytics is web pixels), then confirm with Query 2 that no emergency second sender remains.
- Payment redirects that never return to a page that pushes the paid event.
  - 3-D Secure challenges, wallets, bank redirects and buy-now-pay-later flows send the customer away. Some never come back (closed tab, app switch). Others come back to a URL the tag does not cover, such as an order page instead of the confirmation step.
  - The return is a fresh page load. Any purchase data held in the data layer before the redirect is gone, so a tag that reads it fires empty or not at all.
  - Detect: Query 7 flags the redirect flows as suspects against the control; `page_paths` in Query 5 for matched redirect orders shows which return paths do push the event.
  - Evidence: one test payment per redirect method in a test environment, with the data layer and the outgoing collection request recorded on the return page.
  - Fix: push the paid event on every return path from server-rendered order data, or move to server-confirmed sending (see [browser-vs-server.md](browser-vs-server.md)).
- Hosted or cross-domain checkout with no sender on the return domain.
  - A checkout or thank-you page on another domain, or a third-party hosted checkout, does not carry the purchase sender, or carries it without cross-domain linking.
  - Detect: `page_hosts` in Query 3 for matched orders shows only the main domain while orders from the hosted flow are missing; or the purchase arrives with a new user and the payment domain as referral.
  - Fix: Google's cross-domain measurement setup (Admin, Data streams, the web stream, Configure tag settings, Configure your domains; checked 2026-10-17) with the sender installed on the other domain, or move the confirmation to a page you control. Hand to cross-domain-and-spa-qa when installed.
- The confirmation page never loads.
  - Upsell and post-purchase pages can replace it. On Shopify, `checkout_completed` fires on the first upsell page when one exists and does not fire again on the thank-you page; if the page that should trigger it never loads, it is not sent (checked 2026-10-17).
  - Detect: high miss rate for orders with an upsell step, or a trigger written on a thank-you URL.
  - Fix: trigger on the platform's checkout event, not a URL.
- A trigger with a hidden condition.
  - A purchase trigger that also filters on region, language, customer type or a page path regex silently scopes the tag.
  - Detect: one segment (a country, new versus returning, one domain) misses close to 100% while others look normal.
  - Fix: read the stored trigger conditions; hand to gtm-container-audit, then to gtm-change-workflow or, when that skill is not installed, a GTM workspace change reviewed in Preview mode.
- An empty or broken ecommerce payload.
  - The tag fires but `transaction_id`, `value` or `items` are empty, for example after an API write stripped a setting, a data layer rename, or a tag reading the wrong data layer object.
  - GA4 deduplicates all purchase events with `transaction_id` set to an empty string (checked 2026-10-17), so in reports many orders collapse into one. In the export they appear as rows without a key and cannot match.
  - Detect: Query 0 `purchases_without_ecommerce_transaction_id`, Query 1 `rows_without_transaction_id` and `rows_without_items`, rising from a release date.
  - Fix: tag configuration. After any write through an API, read the stored tag back; do not trust the request.
- Wrong destination or filtered data.
  - The tag sends to another measurement ID, the stream is not linked to the export, the event is in the export exclusion list, or an active data filter removes it. Data removed by a filter never reaches GA4 or BigQuery (checked 2026-10-17).
  - Detect: Query 0 shows zero or low purchases for a stream; compare with the Data API for the same days.
  - Fix: property or export settings, by an admin.
- Delayed payments placed before the scan window.
  - Bank transfer and invoice orders can fire `purchase` at placement, days before payment. If placement falls before the scan window, the row is outside the join.
  - Detect: the order-side extract check lists eligible orders placed before `scan_window_start`.
  - Fix the run, not the tag: widen `scan_window_start` in the contract to the earliest placement, re-run Query 0 for the new days and re-classify. Found rows are `late` with `fired_before_business_ts`, never `missing`. Report the window used.
- Late arrivals GA4 ignores.
  - GA4 ignores events that arrive more than 2 calendar days plus today after they were triggered (checked 2026-10-17). Hits queued in an offline device or a stalled server queue can be lost this way.
- Orders that never had a browser journey.
  - Phone orders keyed by staff, admin-created orders, renewals and marketplace orders. They should be excluded by the channel rule; if they are eligible, the contract is wrong, not the tag.

## Duplicate

More than one purchase row, or more than one raw ID, maps to the order.

How GA4 treats repeats (checked 2026-10-17):

- Google says reports deduplicate purchases with a repeated transaction ID from the same user, on web streams only; app streams are not deduplicated, and the same ID should not be used across users.
- Google does not mention deduplication in the BigQuery export, which it describes as the raw event data GA4 receives. Practitioners observe that the export keeps every repeated row; this is not documented.
- A revisit from another device or browser, such as the email link opened on a phone, is a different user, so it may stay duplicated in reports too.
- Before relying on any of this, check one known reloaded order: two export rows with its `transaction_id`, and how many purchases the Data API shows for that ID.

Fix duplicates even when reports hide them. Ad platforms deduplicate only when they get a matching ID: Google Ads drops a second conversion with the same transaction ID for the same conversion action (checked 2026-10-17). Check whether each ad tag sends the order ID before calling its counts inflated.

- Transport or export repeats.
  - Identical rows: same user, same microsecond timestamp, same batch position. A retried network request, not a second purchase.
  - Detect: `flag_duplicate_identical_row` (Query 2 `transactions_with_identical_rows`). Report apart from reloads and second senders; it is not a tag defect. Check whether the processed reports show it before calling it a reported duplicate.
- Reloads and revisits of the confirmation or order-status page.
  - Back button, refresh, a bookmarked status page, or the "view your order" link in the confirmation email.
  - Detect: browser rows only, `minutes_first_to_last_row` from minutes to days, and the later row on an order-status path in `page_paths`.
  - Fix: send once per order. Mark the order as sent on the server and render the flag into the page, or keep a sent marker keyed by order ID in browser storage as a weaker fallback. Server-confirmed sending removes the problem.
- Two senders.
  - A platform app plus GTM, a theme snippet plus a custom pixel, or browser plus server during a migration.
  - Detect: Query 2 `both_senders`; Query 1 shows two sender labels with similar transaction counts.
  - Fix: one owner per event and destination. Before removing either, count the orders only it captures (Query 2 `browser_only` and `server_only`); those are lost with it.
- Two ID formats for one order.
  - One sender uses the display name (`#1042`), another the internal ID or a checkout token.
  - Detect: `flag_duplicate_different_ids`. These are never deduplicated by GA4.
  - Fix: one format, recorded in the purchase contract, with a historical mapping kept for old data.
- Server retries without a business key.
  - Webhooks are delivered more than once: Stripe retries live-mode deliveries for up to three days, can deliver the same event twice and does not guarantee order (checked 2026-10-17). Several event types can also describe one payment.
  - Detect: server rows with identical values seconds to hours apart.
  - Fix: one business key per payment and a delivery ledger with a uniqueness constraint (stripe-conversion-tracking, or Stripe's webhook guide when that skill is not installed).
- Order edits sending a second purchase.
  - An accepted upsell or a price change that re-sends `purchase` for the same order.
  - Fix: the original purchase stays; later changes follow the adjustment or refund route.

## Value mismatch

One row exists, but currency differs, value is missing, or value differs from `expected_value` by more than one minor unit per item line. Judge the rate on `flag_value` or `flag_currency` over observed orders, not on the primary class: a duplicate or late order can carry the same defect.

- Value sent as the order total.
  - GA4's `value` is items times quantity without shipping or tax. Integration examples often map the checkout total instead: Shopify's GTM custom pixel tutorial maps `value` from `checkout.totalPrice`, which Shopify describes as including duties and taxes, while also sending tax and shipping separately (checked 2026-10-17).
  - Detect: `hint_value_is_order_total`.
  - Fix: map value to items after discounts.
- Stale ecommerce object.
  - Without a reset, items or a coupon from an earlier push leak into `purchase`. Google's GTM ecommerce examples push `ecommerce: null` before every ecommerce event (checked 2026-10-17).
  - Detect: Query 1 `rows_value_not_equal_items_total`, and on named orders, item lines or a coupon that belong to an earlier step.
  - Fix: push `{ ecommerce: null }` before each ecommerce event.
- Minor units sent as major units.
  - Billing APIs often store amounts in minor units. Stripe expects `1099` for 10.99 USD and `10` for 10 JPY, and some currencies have special rules, so a blanket division by 100 is wrong (checked 2026-10-17).
  - Detect: `hint_value_in_minor_units`, or a ratio of exactly 100 between the two sides.
- Currency problems.
  - Presentment versus shop currency: the customer paid in EUR but the event carries the shop's USD amount, or the reverse. Currency missing: GA4 requires `currency` whenever `value` is set (checked 2026-10-17).
  - Detect: `flag_currency`; currency missing makes `flag_value` true.
  - Fix: send the presentment amount with the presentment currency, and compare in that currency.
- Value sent as text.
  - Detect: Query 1 `rows_value_as_string`. Fix: send a number.
- Discounts.
  - Value before an order-level discount, or a discount not allocated to items. Detect: the difference equals the discount.
- Tax-inclusive prices.
  - Item prices include VAT. Whether `expected_value` removes it is a contract decision; mismatches appear when the tag and the contract decided differently.
- Order edits after the event.
  - Accepted upsells, price adjustments or partial cancellations before capture. Detect: the difference equals the added or removed lines.
- Refunds compared with gross.
  - Comparing the purchase value with the order's current total after refunds. GA4's Purchase revenue metric subtracts refunds and Gross purchase revenue does not (checked 2026-10-17). Compare the purchase with the original order; reconcile refunds separately (ga4-ecommerce-and-refunds, or Google's GA4 ecommerce guide when that skill is not installed).
- Gift card redemption.
  - A tender: it lowers the amount charged, not the item value. Do not subtract it from `expected_value`.
- Gift cards sold.
  - An item line. The contract decides whether it counts in `expected_value`.
- Store credit, tips, duties, fees.
  - In the charged total, not in item value. Keep them out of `expected_value` unless the contract says otherwise.

## Late

A row exists but sits outside the period on the order's clock, arrives more than 60 minutes after the business timestamp, or arrives more than 5 minutes before it.

- Time zone mismatch.
  - `event_date` uses the property's reporting time zone; `event_timestamp` is UTC in microseconds (checked 2026-10-17). Warehouses often store UTC, stores their own zone.
  - Detect: late rows cluster near midnight with small lags. The worksheet compares on one clock; if the property's zone differs from the business zone, say so in the report.
  - Fix: compare on one clock. A change to the property's reporting time zone applies only going forward (checked 2026-10-17), so a series that spans the change needs a note.
- Purchase sent at placement (`fired_before_business_ts`).
  - The browser sends before payment confirms. Paid-later orders look early; never-paid orders become analytics-only.
  - Fix: hold until paid ([browser-vs-server.md](browser-vs-server.md)).
- Authorization and capture apart.
  - With manual capture, the thank-you page fires at authorization and capture follows days later. Under `paid_definition: captured` every such order is `fired_before_business_ts`.
  - Fix the contract first: if the business counts revenue at authorization, set `paid_definition: authorized`. Only then judge the tag.
- Delayed payments sent on payment.
  - Server sends at payment, days after the session. The row is correct for a paid-date contract and late for a placed-date one. Decide in the contract, do not move the timestamp.
- Queued or failed server sends.
  - Detect: the lag distribution for server rows. Report median and the slowest 5%; a long tail points to queue stalls or retries.
  - Fix: alert well before 24 hours (session attribution) and before 72 hours (backdating limit).
- First page load from an email link.
  - Browser rows hours or days late on an order-status path. Usually the same defect as reload duplicates.

## Analytics-only

A transaction in the period with no eligible order. Query 8 gives the reason from the order side.

- `unpaid`: purchase sent for an order that never reached the contract's paid state. Fix with hold until paid. Any of these is a defect, because it reports revenue that never existed.
- `authorized_not_captured`: under `paid_definition: captured`, the order is authorized and capture is still due. Pending, not a defect: list it, and re-check after the capture window. If it later voids or expires, it becomes `unpaid`.
- `test_order`: staff tests on the live store. Fix with a test flag excluded at collection, or a separate property.
- `no_order_found`:
  - A staging or development host sending to the live property: check `hosts_seen`.
  - A provisional ID with no mapping, or a second store sharing the property: fix the key or store map.
  - A confirmation URL that sends `purchase` when opened without an order (bots, shared links): check for odd values and IDs that match no pattern.
- `outside_period`: the order belongs to the next or previous period. These pair with `late` rows; report them, do not count them as errors twice.
- `other_channel` and `cancelled_before_payment`: staff using the web checkout for phone orders, or orders cancelled before payment. Contract or process fix.

## Rows without a transaction ID

Purchase rows with no usable key cannot join. Count them in Query 1 and report them next to the missing class: they are usually the same orders, sent with an empty payload.
