GA4 ecommerce tracking is only useful when product interactions, revenue, refunds, and promotions form one reliable measurement path. This guide gives you an event-by-event implementation checklist, example payloads, duplicate-purchase controls, and a validation workflow you can reuse whenever your catalog, checkout, payment provider, or campaign setup changes.
Overview
A practical GA4 ecommerce implementation usually covers the customer journey from product discovery to completed order:
- Product discovery:
view_itemrecords a product detail view. - Cart activity:
add_to_cartrecords an item added to the basket. - Checkout:
begin_checkoutrecords the start of the payment or order flow. - Purchase:
purchaserecords a completed transaction and its revenue. - Post-purchase changes:
refundrecords a full or partial refund. - Merchandising:
view_promotionandselect_promotionmeasure promotion exposure and clicks.
Use GA4's recommended event names rather than creating alternatives such as product_viewed or order_complete. Consistent names make reporting, explorations, audiences, and downstream exports easier to maintain. Keep your event design in a tracking plan so developers, analysts, and marketing users share the same definitions. The GA4 event tracking plan template can help document names, triggers, parameters, owners, and QA status.
For most ecommerce events, the central object is the items array. Each item should identify the product consistently and include the item-level fields your business needs, such as item name, category, brand, quantity, and price. Decide whether prices include tax, shipping, discounts, or other adjustments, then apply that convention consistently across the storefront, GA4, and your order system.
Checklist by scenario
1. Product detail view: view_item
Fire this event when a user views a product detail page or an equivalent product detail state in a single-page application. Send an items array containing the product identifier and the product information needed for analysis.
gtag('event', 'view_item', {
currency: 'USD',
value: 49.99,
items: [{
item_id: 'SKU-123',
item_name: 'Example Jacket',
price: 49.99,
quantity: 1
}]
});
Use the same item_id convention throughout the funnel. Do not use a database ID on one page and a product SKU on another unless both are deliberately documented and joined in reporting.
2. Add to cart: add_to_cart
Fire the event after the cart accepts the item, not merely when a user clicks a button. Include the actual quantity and price used for the cart line. If a user adds three units, the event should not report a quantity of one.
gtag('event', 'add_to_cart', {
currency: 'USD',
value: 99.98,
items: [{
item_id: 'SKU-123',
item_name: 'Example Jacket',
price: 49.99,
quantity: 2
}]
});
3. Checkout start: begin_checkout
Send this event when the customer enters the checkout flow with a meaningful cart. Include the current cart contents rather than the last item clicked. If your checkout runs on another domain, document the domain transition and test session continuity separately. The GA4 cross-domain tracking troubleshooting workflow covers common referral and session issues.
gtag('event', 'begin_checkout', {
currency: 'USD',
value: 149.97,
items: [
{ item_id: 'SKU-123', item_name: 'Example Jacket', price: 49.99, quantity: 2 },
{ item_id: 'SKU-456', item_name: 'Example Hat', price: 49.99, quantity: 1 }
]
});
4. Completed order: purchase
The purchase event is the most important part of GA4 revenue tracking. Send it only after the order is accepted by the commerce system or payment workflow according to your business definition of a completed order. Include a stable transaction_id, the transaction value, currency, and the final item list.
gtag('event', 'purchase', {
transaction_id: 'ORDER-100045',
value: 149.97,
tax: 12.00,
shipping: 8.00,
currency: 'USD',
coupon: 'SPRING10',
items: [
{ item_id: 'SKU-123', item_name: 'Example Jacket', price: 49.99, quantity: 2 },
{ item_id: 'SKU-456', item_name: 'Example Hat', price: 49.99, quantity: 1 }
]
});
Treat transaction_id as an idempotency control. The same order should produce the same identifier if the confirmation page is refreshed. A server-confirmed order endpoint, data layer state that survives reloads, or a purchase ledger can help prevent repeat sends.
5. Refunds: refund
Use refund when an order is fully or partially refunded. Reference the original transaction and send the refunded amount and, where useful, the affected items. Decide whether refunds are sent immediately from the order system or through a scheduled reconciliation process; do not mix both without a deduplication rule.
gtag('event', 'refund', {
transaction_id: 'ORDER-100045',
value: 49.99,
currency: 'USD',
items: [{
item_id: 'SKU-123',
item_name: 'Example Jacket',
price: 49.99,
quantity: 1
}]
});
6. Promotions: view_promotion and select_promotion
Use view_promotion when a promotion is actually presented in a measurable placement and select_promotion when the user selects it. Include stable promotion identifiers and placement details where available. Do not fire promotion views for every promotion configured in a CMS if those promotions were not visible to the user.
gtag('event', 'select_promotion', {
promotion_id: 'SPRING10',
promotion_name: 'Spring 10% off',
creative_slot: 'homepage_hero',
items: [{
item_id: 'SKU-123',
item_name: 'Example Jacket'
}]
});
What to double-check
Implementation and data layer
- Event names are lower-case and match the intended recommended events.
- Every ecommerce event sends an
itemsarray when product context exists. - Product IDs, names, categories, prices, and quantities are populated from the source of truth rather than hard-coded test values.
currencyis present whenever monetary values are sent, using the currency convention configured for the transaction.- The purchase value follows one documented rule and is compared with the order system's subtotal, tax, shipping, discounts, and total.
- Refunds use the original transaction identifier and cannot be emitted twice by both browser and server processes.
Browser and network validation
- Use a test order or a controlled staging flow. Record the expected event sequence and order total before testing.
- Open browser developer tools and inspect the data layer or event payload at each step. Confirm that the values are correct before checking GA4.
- Inspect network requests to the Google measurement endpoint and verify that the event name, transaction ID, currency, value, and item fields are present. If Google Tag Manager is used, use Preview mode to confirm the correct trigger and tag.
- Open GA4 DebugView while the test device is eligible for debug collection. Check that the events arrive in the intended order and that parameters are visible on the event details.
- Confirm that the purchase event is not sent on page load more than once, after a payment retry, or when a user revisits the confirmation URL.
- Compare the test order with the ecommerce platform, payment processor, or order database. A successful network request is not proof that the reported revenue is correct.
Consent configuration can affect whether analytics requests are sent or whether identifiers are available. Test each relevant consent state rather than approving consent globally during QA. For a broader implementation checklist, see the Consent Mode v2 implementation guide.
Reconciliation after release
For the first reporting period after launch, compare GA4 purchase counts and revenue with the source-of-truth order system by day, currency, and channel where possible. Investigate patterns, not just totals: a sudden drop in purchase events, a rise in orders without transaction IDs, or revenue that differs by a consistent tax or shipping amount usually points to a definition or implementation mismatch. If you export data to BigQuery, use it for row-level checks and longer-term reconciliation; the GA4 BigQuery export guide provides a related schema and QA workflow.
Common mistakes
- Using page views as purchases: A thank-you page view is not a reliable order signal when users can reload, revisit, or share the URL.
- Missing transaction IDs: Without a stable identifier, duplicate-purchase diagnosis and reconciliation become much harder.
- Sending a purchase from both client and server: Browser tags and server-side tagging need an explicit ownership and deduplication design. The server-side Google Tag Manager setup guide covers architecture questions to review.
- Mixing currencies or value definitions: A product price in one currency and an order total in another can make revenue reports misleading.
- Firing events before state changes complete: Record add-to-cart and checkout events after the cart or checkout has accepted the action.
- Replacing the item list with a generic event: An event such as
purchase_completemay be easy to create but will not automatically provide the ecommerce structure expected by GA4 reports. - Testing only the happy path: Include payment failure, retry, cancellation, partial refund, cross-domain checkout, consent denied, and single-page navigation scenarios.
When to revisit
Review this GA4 ecommerce tracking checklist before seasonal planning cycles and whenever the workflow or tools change. At minimum, schedule a recurring review around product catalog changes, checkout redesigns, payment provider migrations, new currencies, tax or shipping logic changes, consent-management updates, promotion launches, and tag-management releases.
A useful monthly routine is to select a sample of orders, compare their transaction IDs and totals across the order system and GA4, review duplicate or missing purchases, and inspect the highest-volume item IDs for naming or price anomalies. Repeat the test after major GA4 interface or implementation changes rather than assuming an existing tag still behaves the same way.
Before publishing a seasonal campaign, run one controlled order through product view, cart, checkout, purchase, and refund. Save the payloads, expected totals, screenshots or debug notes, and the person who approved the result. This creates a small but durable audit trail and makes future debugging faster.
Action plan: document the event contract, test each scenario in a clean browser session, verify the network request and DebugView result, reconcile one order with the source system, then monitor production data for the first reporting cycle. Reuse the same checklist whenever your catalog, checkout, payment flow, consent setup, or promotion logic changes.