Skip to content

How to Set Up GA4 (Google Analytics 4) for Ecommerce Tracking

Step-by-step GA4 ecommerce tracking setup: GTM container, ecommerce events, server-side tagging, DebugView validation, and the seven failures to avoid.

Google Analytics logo on white
Google Analytics logo · Credit: Google

GA4 (Google Analytics 4) ecommerce tracking is a measurement configuration that captures purchase pings, product impressions, and checkout funnel steps inside GA4's event-based data model, giving ecommerce operators a unified view of revenue attribution across web and app surfaces. See also: Surfer SEO. See also: realtime CRM analytics. See also: traditional analytics. See also: Looker alternative. The BI platform comparison of Tableau, Power BI, and Looker covers where exported GA4 data lands downstream.

Universal Analytics (UA) collected data as typed hits: pageviews, events, and transactions were separate constructs with separate processing pipelines. GA4 collapses that hierarchy. Every user interaction, from a product list scroll to a completed checkout, becomes a named event object carrying parameters. That architectural difference means a UA ecommerce implementation cannot be migrated by changing a tracking ID. The tag configuration, the event schema, and the push scaffolding all require a clean rebuild.

The sections below walk through that rebuild in five ordered steps, then cover the server-side tagging architecture that preserves hit fidelity under ad-blocker and ITP (Intelligent Tracking Prevention) constraints.

How GA4 Ecommerce Tracking Differs From Universal Analytics

Ecommerce reports in GA4 surface failures in ways that are not always obvious. Zero revenue does not always mean the purchase ping is missing; it often means a required parameter is null. The five failure patterns below cover the errors that appear most often in production implementations. Teams building broader data export pipelines from GA4 into reporting tools should also review Excel and Power BI integration guide for downstream data modeling considerations.

Video thumbnail shows Google Analytics 4 tutorial for beginners (2026 update) GA4 tutorial for beginners GA4 course
Google Analytics 4 tutorial for beginners (2026 update) || GA4 tutorial for beginners || GA4 course. Video: Analytics Mania - Google Analytics & Tag Manager via YouTube.
  • Zero revenue in Monetization reports. Cause: the purchase ping fires but transaction_id or value is missing or sent as null. GA4 records the event but cannot populate revenue metrics without a numeric value. Fix: open GTM Preview mode, locate the transaction event in the tag output, and confirm the ecommerce object contains a non-null value and a non-empty transaction_id string before the tag fires.
  • Duplicate transactions in the Monetization report. Cause: the thank-you page is cached or revisited, and the purchase ping fires again because the GTM trigger is set to All Pages or DOM Ready instead of a Custom Event matching the purchase dataLayer event name. Fix: change the trigger to a Custom Event that fires only when event equals purchase in the push payload. Additionally, deduplicate on transaction_id server-side before pushing so that confirmation page reloads do not re-push the event.
  • Item-level data missing from product reports. Cause: the items array is pushed as empty, or item objects use non-standard parameter keys (for example, sku instead of item_id, or name instead of item_name). GA4 does not infer parameter mappings; non-standard keys are silently dropped. Fix: validate every item object against the ecommerce event schema and confirm item_id, item_name, and price are present in each entry. Use Debug View panel to inspect the items array parameter directly.
  • GA4 and Google Ads conversion counts diverge. Cause: GA4 counts conversions per session while Google Ads counts per ad click. Attribution windows differ by default (GA4 uses 30-day sessions; Ads uses last-click with a 30-day or 7-day window depending on the conversion action setting). Fix: align conversion windows in both platforms and confirm the linked Google Ads conversion action imports from GA4 using the All conversions model. Reviewing conversion tracking discrepancies requires access to both platforms simultaneously.
  • Server-side container drops hits. Cause: the transport_url in the client-side configuration tag points to the wrong subdomain, or the CNAME record has not propagated. Fix: run curl -v https://metrics.yourstore.com/g/collect directly against the server container endpoint to confirm a 200 response before redirecting client-side traffic. If the endpoint returns a certificate error, the TLS certificate for the subdomain has not been provisioned; check the Cloud Run service configuration and rerun the certificate request.

Further reading

For deploying server-side tag delivery containers, see AWS CloudFront for tag delivery.

Share this guide

Marcus Vetri

Marcus Vetri covers developer tools for techshooked: the IDEs, package managers, build systems and runtimes that engineers keep open all day. A new release gets read against its changelog and its documentation, with the version it applies to named, so a team can tell in a few minutes whether an update changes how they work or only how the vendor describes it.