E-commerce checks in detail

E-commerce is the area where even small tracking gaps lead to big revenue gaps in your reporting. The Auditor checks this on two levels: live (via the GA4 Data API) and in depth (via BigQuery).

What does the app check?

Four key topics sit behind the e-commerce checks:

  1. Required events present - view_item, add_to_cart, begin_checkout and purchase all have to be measured.
  2. Funnel completion - how many sessions that fire a begin_checkout actually make it all the way to purchase?
  3. Duplicates - are purchases accidentally being recorded twice?
  4. Transaction attribution - are purchases assigned to clean channels, or do they land disproportionately on Direct and Unassigned?

When does a check trigger?

Straight from the code:

Check Threshold
Required events all four present = green; one missing = red
Funnel completion (purchase / begin_checkout) >50 % = green, 20-50 % = yellow, <20 % = red
Duplicate transactions >1 % duplicate purchase = warning
Direct/Unassigned on purchases <15 % = green, 15-30 % = yellow, >30 % = red

The logic lives in app/services/ga4_api_check_service.py:_run_data_checks() (required events + attribution) and in the SQL queries ecommerce_funnel.sql, ecommerce_transactions.sql and duplicate_events.sql.

Common causes

  • Missing purchase events → checkout runs on a subdomain without tracking, the payment redirect URL clears cookies before the trigger, headless/no-JS checkout.
  • Duplicate transactions → reload of the thank-you page, a popup workflow fires the trigger multiple times, faulty dedup logic in GTM, a parallel Universal Analytics implementation is still running. Deeper background in the blog post Duplicate purchases in GA4.
  • Incomplete item dataprice and item_id are passed as (not set) because dynamic fields never make it into the dataLayer.
  • High Direct share on purchases → payment provider as referrer (see the blog post Banks and payment providers as referrers) or cross-domain tracking without a _ga cookie pass.

How to proceed

  1. Required events first - if purchase is missing, any further analysis only pays off once the tracking is running.
  2. Open the funnel section create_ecommerce_funnel_section - it shows the drop-offs between view_itemadd_to_cartbegin_checkoutpurchase as a Sankey/bar chart.
  3. Check the duplicates section create_duplicate_transactions_section - it lists the concrete transaction IDs that fired more than once, including revenue impact.
  4. Cross-check attribution with Attribution & acquisition quality.
  5. For item-data problems, read on in Event quality & PII notes
  • that's where the PII and (not set) diagnosis lives.