E-commerce

GA4 Ecommerce Tracking: Events, Setup and Verification

How to set up and verify GA4 ecommerce tracking: the events to send, exact purchase event parameters, DebugView testing, why revenue goes missing, key events, attribution settings and weekly reconciliation.

GA4 Ecommerce Tracking: Events, Setup and Verification
19minRead time · 220 wpm
4,172Words
30Sections
Published

Many ecommerce stores run GA4 for months before anyone checks whether the revenue number is right. The purchase event fires, the dashboard shows something, and the team moves on. Then a campaign review compares GA4 with the store admin and the two numbers are far apart, with no clear reason why.

This guide explains GA4 ecommerce tracking in the order you should build and verify it: the events to send, the exact purchase event rules, how to test before launch, why revenue goes missing, and how key events, attribution and referral settings change what you see. It is written for store owners, marketers and developers who need numbers they can trust when they make budget decisions.

Quick Summary

GA4 ecommerce tracking depends on a short list of events sent from your site, with the right parameters on each one. The purchase event matters most. It needs a currency, a transaction ID and an items array, plus a numeric value, and the transaction ID must be unique for every order. Test with DebugView before launch, use either Google Tag Manager or gtag.js but not both, and compare GA4 against your store orders on a fixed schedule so small gaps never grow into large ones.

  • Send the full funnel: view_item, add_to_cart, begin_checkout, add_shipping_info, add_payment_info and purchase give you a complete purchase journey.
  • Get purchase exactly right: currency, transaction_id, items and a numeric value are the parts that revenue reports depend on.
  • Never send an empty transaction ID: GA4 treats all empty IDs as the same order and keeps only one.
  • Test before you trust it: DebugView shows events and parameters in near real time, and standard reports can take 24 to 48 hours to settle.
  • Set attribution on purpose: lookback windows and the paid and organic setting change which channel gets credit.
  • Fix referral leaks: add payment gateways to the unwanted referrals list and set up cross-domain measurement when checkout lives on another domain.
Priority What to do Why it matters
Critical Send purchase with currency, transaction_id, items and value Revenue metrics are built from these parameters
Critical Use one tagging method only Running gtag.js and Tag Manager together double-counts some events
High Verify every event in DebugView A missing required parameter turns an ecommerce event into a custom event
High Exclude payment gateways and fix cross-domain checkout Stops paid sales being credited to a payment provider
Medium Review attribution settings Lookback windows and models change channel credit
Medium Reconcile GA4 with store orders weekly Finds tracking problems while they are still small

What Does GA4 Ecommerce Tracking Measure?

GA4 ecommerce tracking measures how shoppers move through your store and what they buy. It does not collect these events on its own. Google's guidance on the Ecommerce purchases report says ecommerce events such as add_to_cart and purchase must be sent from your website or app, and that events missing required parameters are treated as custom events and do not appear in the report.

Some platforms help. The same page says Shopify stores automatically collect add_to_cart, begin_checkout and purchase once Google Analytics is set up, while other recommended events need manual setup.

Which GA4 Ecommerce Events Do You Need?

At minimum, send the events that form the purchase funnel. Google's developer guide to measuring ecommerce lists the full set. The table below groups the ones a typical store needs.

Event When it fires What it tells you
view_item_list A shopper sees a list of results Which collections and search results get seen
select_item A shopper selects an item from a list Which listed products earn clicks
view_item A product page is opened Interest in each product
add_to_cart An item is added to the cart Buying intent by product
view_cart The cart is viewed Cart engagement
begin_checkout The first checkout step starts Checkout entry rate
add_shipping_info Shipping details are added Drop-off at the shipping step
add_payment_info Payment details are submitted Drop-off at the payment step
purchase A purchase completes Orders and revenue
refund A refund is issued Returned revenue

Google also lists add_to_wishlist, remove_from_cart, view_promotion and select_promotion. Add those once the core funnel is accurate.

How Do You Set Up the GA4 Purchase Event Correctly?

Send purchase with a currency, a unique transaction ID, an items array and a numeric value. These are the fields Google names as required for revenue metrics in its guide to fixing missing revenue data. Optional fields such as tax, shipping and coupon add detail, and Google recommends setting every ecommerce parameter you have data for.

Level Parameter Rule
Event currency A three-letter ISO 4217 code, set at the event level
Event transaction_id Unique for each order
Event value A number, placed at the event level
Event items An array with one entry per product
Item item_id or item_name At least one identifier per item
Item price A number, placed at the item level, used for item revenue

What Goes in the Items Array?

The items array holds one entry for each product in the order. According to Google's ecommerce documentation, the array can hold up to 200 elements and you can add up to 27 custom parameters to each item. Standard item fields include item_id, item_name, item_brand, categories from item_category to item_category5, item_variant, price, quantity, discount and coupon.

Consistent item names and categories pay off later. The Ecommerce purchases report breaks results down by item brand, category, ID and name, so messy naming becomes messy reports. Our guide to SEO for ecommerce product pages covers how to keep product names consistent across your site.

How Should Value and Currency Be Formatted?

Send value and price as plain numbers, with no quotation marks and no currency symbols. Put the currency in its own parameter as a three-letter code. Google lists these as the most common causes of missing revenue:

  • Text instead of numbers: value and price sent as strings.
  • Wrong level: value placed on an item, or price placed on the event.
  • Bad currency format: anything other than a three-letter ISO 4217 code.
  • Spelling or case errors: parameter names should be spelled exactly and in lowercase.
  • Tag Manager gaps: the purchase event must be set up in both the data layer and the GA Event tag.

The developer guide's own code comment also says value should equal the sum of price times quantity for all items. Build that check into your tests.

Why Does the Transaction ID Matter?

The transaction ID is how GA4 tells one order from another. Google's page on minimizing duplicate key events with transaction IDs says purchase events that share an ID are deduplicated, so a repeated purchase with the same ID is counted once. It also lists rules worth enforcing:

  • Unique per order: use something like an order confirmation number.
  • Dynamic: reusing one fixed ID across transactions can significantly undercount key events.
  • Never empty: GA deduplicates all purchase events where transaction_id is an empty string.
  • Not personal: IDs must not contain information that could identify individual customers.
  • Web streams only: this deduplication works for web streams, not app streams.

The fix lives in your site code, not in the GA interface. If you view the page source after a test order, confirm that the server-side placeholder has been replaced by a real order number.

Where Should the Purchase Event Fire?

Fire it once per order, after the order is confirmed. Google's guide to setting up a purchase event shows two patterns. Placing the event in a script fires it when the page loads, which suits a confirmation page. Attaching it to a button click listener fires it only when that button is clicked. Because a confirmation page can be reloaded, pair the page-load pattern with a unique transaction ID so a refresh does not create a second order.

Should You Use Google Tag Manager or gtag.js for Ecommerce Tracking?

Use one of them, not both. Google's validation guide says running gtag.js and Google Tag Manager together double-counts some events. Add the Google tag to every page, choose one method, and remove the other.

Method Fits when Watch out for
gtag.js on the site A developer controls the page code and templates Events must come after the Google tag and sit inside JavaScript
Google Tag Manager Marketers need to change tags without a code release The purchase event must exist in both the data layer and the GA Event tag
Built-in platform integration Your store platform sends standard events for you Check which events it sends and add missing ones manually

How Do You Test GA4 Ecommerce Tracking Before Launch?

Use DebugView, then run a full test order. Google's page on DebugView explains that it shows events and user properties from a device in near real time. You click an event to see its parameters, and if the event includes an items array, an extra items tab appears.

How Do You Turn On Debug Mode?

DebugView needs debug mode on the device you are testing. For websites, Google lists three routes:

  • Tag Assistant: use preview mode, which adds a parameter to your site's URL.
  • gtag.js: add debug_mode set to true to the config command, or to specific event commands.
  • Google Tag Manager: set debug_mode to true in the Google tag for all events, or in the GA Event tag for selected events.

To turn it off, remove the parameter. Setting it to false does not disable it. Google also advises filtering developer traffic so debug sessions do not skew your reports.

What Can Hide Events in DebugView?

Privacy controls and consent settings can. Google says events are not visible in debug mode if you have implemented client-side privacy controls, and they are also hidden when consent mode is used and the user has not consented to Analytics cookies. If your test events do not appear, check your consent banner state before you assume the tag is broken.

What Should a Test Order Check?

Run one complete order on mobile and one on desktop, and confirm each step below in DebugView.

  1. view_item fires on a product page with item_id or item_name.
  2. add_to_cart fires once for each add, with the right quantity.
  3. begin_checkout, add_shipping_info and add_payment_info fire in order.
  4. purchase fires once, with currency, transaction_id, items and a numeric value.
  5. value matches the sum of price times quantity for all items.
  6. A repeat order gets a different transaction ID.

The validation guide adds a testing detail: a repeated transaction_id makes Analytics keep only the first event, even if other values changed. During testing, change or remove the ID so each test event is recorded. Also watch for a missing comma between parameters, because Google says it can cause Analytics to ignore that event and every event after it.

How Long Until GA4 Reports Show the Data?

Realtime data is quick, but standard reports take longer. Google's data freshness page says Realtime typically takes a few minutes, while standard report processing can take 24 to 48 hours. For standard properties, intraday data is typically 2 to 6 hours old, and these timings are not guarantees. Wait for processed data before you judge a fix.

Why Is GA4 Revenue Missing or Wrong?

Most revenue problems trace back to parameters, not to GA4 itself. Use the table to match what you see with the likely cause.

Symptom Likely cause Fix
Purchases appear but revenue is zero value sent as text, or placed on the wrong level Send value as a number at the event level
Item revenue is missing price missing from items Add a numeric price to each item
Purchase is not in the Ecommerce purchases report A required parameter is missing, so it is a custom event Add transaction_id, items, currency and item identifiers
Orders look undercounted The same transaction_id reused, or an empty string sent Generate a dynamic, unique ID for each order
Events counted twice gtag.js and Tag Manager both installed Keep one method and remove the other
No events after one bad line Syntax error such as a missing comma Check the code and re-test in DebugView
Revenue metrics blank after a Tag Manager change The event is missing in the data layer or the GA Event tag Confirm both are configured

Why Does GA4 Revenue Not Match Your Store Admin?

A small gap is normal, and a large gap means something is wrong. Your store admin records real orders. GA4 records what its tag received, processed and attributed, and several things can create differences:

  • Processing delay: Google says some data can arrive up to seven days late, and events arriving more than two calendar days late, plus today, are ignored.
  • Consent settings: what GA4 receives from shoppers who do not consent to analytics cookies depends on your consent setup.
  • Duplicate or missing IDs: repeated or empty transaction IDs remove orders.
  • Refunds: GA4 measures refunds through a refund event that needs the transaction ID, so refunds you never send are not measured.
  • Attribution changes: Google says key event attribution can change for up to 12 days after the event.

How Do You Reconcile GA4 With Your Store Each Week?

Compare the same date range across three sources and record the gap. Use a closed week so late data has settled.

Source What to record What a gap points to
Store admin Order count and item revenue for the week The baseline for real sales
GA4 Ecommerce purchases report Items purchased and item revenue Missing events, bad parameters or duplicate IDs
Ad platform reports Conversions and conversion value Attribution settings and conversion setup

Track the percentage gap each week. A stable gap is easier to live with than a moving one. If the gap jumps after a site change, start with the test order checklist above. For the wider routine, see our guide to how to monitor PPC campaigns.

How Do Key Events Work in GA4?

Key events are the GA4 events you mark as important, such as purchase. Google's page on conversions versus key events says events that measure important actions are now called key events, and any event you collect can become one. A conversion is the term for an important action used to measure ad performance and optimize bidding.

How Do You Use GA4 Key Events in Google Ads?

Link the accounts, then import the key events. Google's guide to measuring web key events from GA4 in Google Ads notes that ecommerce events are automatically enabled as key events, and that you need a linked Google Ads account and a web data stream. Pay attention to these details:

  • Secondary by default: conversion actions created in Google Analytics are set as secondary, so change the action optimization in Google Ads if you want them used for bidding.
  • Value must be numeric: values are imported automatically and must be sent as numbers.
  • Attribution: data-driven is the default for most conversion actions.
  • Change history: conversion changes made in Google Analytics appear only in the Change history page in Google Ads.

If you also track purchases with a Google Ads tag, decide which one drives bidding so the same sale is not counted twice. Our guides to Google Shopping ads management and Performance Max for ecommerce explain why clean conversion data matters for automated bidding.

Which GA4 Attribution Settings Matter for Ecommerce?

Three settings matter: the reporting attribution model, the lookback window and the channels that receive credit. Google's page on attribution settings describes each one.

Setting What Google says Why a store should care
Reporting attribution model Data-driven and rules-based models are available. First click, linear, time decay and position-based were discontinued in November 2023. Credit for a sale can be shared across several touchpoints
Lookback window Acquisition key events default to 30 days, with a 7-day option. Other key events default to 90 days, with 30 and 60-day options. Longer windows let earlier touchpoints receive credit on slower purchases
Channels receiving credit Paid and organic is the default in Analytics reports. Google paid channels is the default in Google Ads reports. Explains why Analytics and Google Ads can disagree

Two further facts help you read reports. The reporting model applies to historical and future data, and it affects event-scoped traffic dimensions such as source, medium and default channel group. Lookback window changes apply going forward. Under data-driven models, metrics can show fractional credit, with contributing touchpoints sharing credit that sums to one.

These settings also explain a common frustration. The same order can be credited to different channels in GA4, in an ad platform and in the store admin. Our guides on break-even Meta Ads for ecommerce and the metrics that improve ROAS show how to judge channels with more than one number.

How Do You Stop Payment Gateways From Taking Credit for Sales?

Add them to the unwanted referrals list, and set up cross-domain measurement if checkout is on another domain. Both fixes protect the source of the sale.

What Are Unwanted Referrals in GA4?

They are domains whose traffic you do not want reported as a referral source. Google's page on identifying unwanted referrals cites third-party payment processors as an example, where customers leave to pay and then return. You can add up to 50 unwanted referrals per data stream, using Data streams, then Configure tag settings, then List unwanted referrals.

Two limits matter. Exclusions do not fix past data, and because attribution uses the last non-direct click, a later direct return from the same user can still be credited to the excluded domain. Google also warns against adding the ignore_referrer parameter to all pages, since you may lose useful traffic-source data.

When Do You Need Cross-Domain Measurement?

You need it when one customer journey spans more than one domain, such as a store and a separate cart or checkout domain. Google's guide to cross-domain measurement explains that without it, each domain gets new cookies, so one user appears as separate users. With it, IDs pass between domains in the _gl URL parameter.

  • Setup: Admin, then Data streams, then Configure tag settings, then Configure your domains. You can create up to 100 conditions.
  • Same tag: every page must use the same G- tag ID from the same data stream.
  • Check the URL: after clicking through to the other domain, confirm the destination URL contains _gl.
  • Watch for redirects: if the destination redirects or does not accept extra query parameters, _gl can be dropped.
  • Watch for scripts: JavaScript navigation or scripts that stop event propagation can prevent _gl from being added.

Which GA4 Reports Should an Ecommerce Store Use?

Start with the Ecommerce purchases report and the Purchase journey report. Together they show what sells and where shoppers leave.

What Does the Purchase Journey Report Show?

It shows how many users drop off between funnel steps. Google's page on the Purchase journey report lists the stages as session start, view product, add to cart, begin checkout and purchase. Abandonment rate appears below each step, and retention rate appears in the header of the next step.

The default view is a closed funnel, where a user counts only at steps completed in sequence. Switch to an open funnel when you suspect a broken experience, because users can then enter at any stage. For example, a shopper who goes straight to checkout without an add_to_cart event still counts. If the open funnel shows many users at checkout with no add-to-cart, your add_to_cart event may not be firing correctly.

Use this report to find the weakest step, then take it to your conversion work. Our overview of ecommerce conversion rate optimization covers what to test once you know where shoppers drop off.

What Are Event Scope and Item Scope in GA4?

GA4 sorts ecommerce data into two scopes. Google's page on ecommerce scopes explains that event scope covers the whole ecommerce event, such as the value of an overall transaction, while item scope covers the products inside it. This is why order-level metrics and item-level metrics can differ. Add-to-carts counts the number of times the event fired, while items added to cart counts individual items.

What GA4 Ecommerce Tracking Checklist Should You Follow?

Run this audit after any site, theme or checkout change. It takes about as long as one test order.

Check How to verify Pass condition
One tagging method Inspect the page source and Tag Manager container Only gtag.js or Tag Manager is installed
Funnel events fire DebugView during a test order Every event from view_item to purchase appears once
Purchase parameters Click the purchase event in DebugView currency, transaction_id, items and numeric value are present
Value matches items Add up price times quantity The total equals value
Transaction ID is unique Run two test orders The two IDs are different
Payment gateway excluded Review unwanted referrals Gateway domains are listed
Cross-domain works Click from store to checkout domain The URL contains _gl
Key events marked Check the Key events page purchase is marked and imported to Google Ads if you use it
Weekly reconciliation Compare GA4 with store orders The gap stays stable

What Common GA4 Ecommerce Tracking Mistakes Should You Avoid?

These mistakes appear again and again, and most are cheap to fix.

  • Sending value or price as text with a currency symbol.
  • Reusing one transaction ID, or sending an empty string.
  • Running gtag.js and Google Tag Manager together.
  • Skipping add_shipping_info and add_payment_info, which hides checkout drop-off.
  • Putting events before the Google tag, or outside JavaScript.
  • Judging a fix before reports have finished processing.
  • Letting a payment gateway appear as a top referral source.
  • Never sending refund events, so refunds are not measured.

Where Should You Start With GA4 Ecommerce Tracking?

Start with one clean test order. Confirm the purchase event carries the four required parts, make the transaction ID unique, and remove any duplicate tagging. Then fix referral and cross-domain leaks, review your attribution settings, and set a weekly reconciliation habit.

If you want a second pair of eyes on your measurement, Seller Splash includes analytics and reporting in its ecommerce marketing services. You can review the agency's case studies or book a free strategy call to talk through your tracking and goals. If you are still working out your profit targets, start with our guides to break-even ROAS and what a good ROAS is for ecommerce.

About the Author

Seller Splash is an ecommerce marketing agency based in New York, working with product brands on paid ads, SEO and answer engine optimization. The agency was founded by Shlomie Spielman, an ecommerce operator with experience managing ad spend across Google, Meta, TikTok and Walmart. Learn more on the About page or see the agency's case studies.

Frequently Asked Questions

What is GA4 ecommerce tracking?

GA4 ecommerce tracking measures how shoppers move from product views to purchase and how much revenue each order brings in. It relies on events you send from your site, such as view_item, add_to_cart, begin_checkout and purchase, with parameters like currency, transaction_id, value and items.

Which parameters does the GA4 purchase event need?

Google lists currency, transaction_id and items at the event level, plus item_id or item_name on each item. Event-level revenue also needs a numeric value, and item revenue needs a numeric price. Missing required parameters can turn an ecommerce event into a custom event.

Why is my GA4 purchase revenue zero?

The most common causes are value or price sent as text, a currency symbol inside the number, value placed on an item instead of the event, or a currency that is not a three-letter ISO code. Check the purchase event in DebugView, then correct the parameter format.

Why are my GA4 orders lower than my store orders?

Common causes include a reused or empty transaction ID, late-arriving data, missing events on some pages or devices, consent settings, and a tag that fires only on certain paths. Google also says some data can arrive up to seven days late. Compare a closed week and track the gap.

Can I use Google Tag Manager and gtag.js together?

Avoid it. Google's validation guidance says running both double-counts some events. Add the Google tag to every page, choose either gtag.js or Google Tag Manager, and remove the other so each ecommerce event fires only once.

How do I test GA4 ecommerce events?

Turn on debug mode through Tag Assistant, the debug_mode parameter in gtag.js or the Google tag in Tag Manager, then place a test order and watch DebugView. Click each event to inspect its parameters. Use a fresh transaction ID for every test, because a repeated ID keeps only the first event.

How long does it take for GA4 ecommerce data to appear?

Realtime data typically appears within a few minutes. Standard reports can take 24 to 48 hours to process, intraday data is typically 2 to 6 hours old, and these timings are not guarantees. Wait for processed data before judging a tracking fix.

What is the difference between a conversion and a key event in GA4?

Google now calls important Analytics events key events, and any collected event can become one. A conversion is an important action used to measure ad performance and optimize bidding. You can create Google Ads conversions from key events once the accounts are linked.

How do I stop payment gateways showing as a traffic source in GA4?

Add the gateway domain to the unwanted referrals list in your web data stream, which accepts up to 50 entries. This works going forward and does not fix past data. If checkout sits on another domain, also set up cross-domain measurement so the session carries over.

Written by

Seller Splash

Seller Splash · New York, NY

Seller Splash is a New York e-commerce marketing agency running paid ads, SEO and AEO for brands that care about margin, not impressions.

More about the team →
Work with us

Want us to run this for you?

Paid ads, SEO, and AEO for e-commerce brands — built around your margins.

Newsletter

Smarter campaigns. Sharper margins.

One tactical email a week — what's working in Google, Meta, TikTok, and marketplace ads.