GA4 ecommerce tracking: Google Analytics 4 setup and key metrics for online stores
You know how much you sold this month, but not where those sales came from, at which checkout step buyers leave, or which products get lots of views and few sales. Without that information, every marketing decision is a gamble.
GA4 ecommerce tracking is how Google's free tool, Google Analytics 4, answers those questions, as long as it's set up properly. That's the problem: many stores have the tag installed, but without ecommerce events, with duplicate purchases, or without respecting cookie consent.
In this guide you'll set up GA4 step by step on WordPress and WooCommerce, measure the complete shopping journey, and learn which reports to look at to sell more.
In short:
- GA4 measures events: every product view, cart, or purchase is an event with parameters like price and currency.
- In WooCommerce, the simplest route is the free Google Analytics for WooCommerce extension; for more control, Google Tag Manager.
- Without ecommerce events (view_item, add_to_cart, begin_checkout, purchase…) your sales reports stay empty.
- Consent mode tells Google the visitor's cookie choice, but you also need a banner.
- Adjust data retention and link Search Console from day one.
What GA4 (Google Analytics 4) is and what changed for stores
Google Analytics is Google's web measurement platform, and GA4 is its current version. It works with events: viewing a page, viewing a product, adding to cart, or buying are recorded as events with parameters, for example the product name, the price, or the currency.
For a store, that lets you reconstruct the complete shopping journey. But GA4 doesn't know on its own what a product or an order is: ecommerce events aren't collected automatically, so you or a plugin must send them.
Another name change worth knowing: important actions, like a purchase, are marked as key events. The term "conversion" is now reserved for the actions used to measure and optimize Google Ads campaigns.
Before you install: define what you want to measure
A good setup starts with business questions, not code:
| Business question | Event or report that answers it |
|---|---|
| Which channel brings buyers, not just visits? | purchase + Traffic acquisition report |
| Which products get lots of views and few sales? | view_item versus purchase in Ecommerce purchases |
| At which checkout step do they leave? | begin_checkout, add_shipping_info, and add_payment_info |
| Are my promotion banners working? | view_promotion and select_promotion |
If you can't answer one of them, you know which event you're missing. Measuring properly is also the first block of the SEO checklist for 2026: without data, you don't know which improvement works.
Setting up GA4 ecommerce tracking on WordPress and WooCommerce
Create the property
In GA4, go to Admin, create an account and a property with your business's time zone and currency (for example, US dollars). Add a web data stream with your store's URL and leave enhanced measurement turned on, which automatically records page views and other basic interactions. Copy the measurement ID, which starts with G-.
Choose a single path for the tag
| Path | Ideal for | Advantage | Watch out |
|---|---|---|---|
| Google Analytics for WooCommerce extension | Stores without a technical team | Sends ecommerce events without code | Needs a compatible consent banner |
| Google's Site Kit | WordPress sites that want Analytics and Search Console in the dashboard | Official, free plugin | Check which ecommerce events it sends before relying on it |
| Google Tag Manager | Stores with several marketing tools | Full control of tags and events | Requires a well-configured data layer |
In the WooCommerce extension, the ID goes under WooCommerce → Settings → Integration → Google Analytics. According to the WooCommerce documentation, it can take up to 48 hours to start working, and to record purchases your payment gateway must redirect to the order received page. The same documentation says it integrates with the WP Consent API.
The golden rule: a single tag. If you install the extension and you also pasted the GA4 code into the theme or with another plugin, you'll count everything twice.
GA4 ecommerce events your store should send
GA4's ecommerce guide describes 14 events. This GA4 ecommerce events list covers the ones a store can't do without:
| Event | What it records | What it's for |
|---|---|---|
| view_item_list | View of a product list | Knowing which categories generate interest |
| select_item | Click on a product in the list | Measuring which products attract from the listing |
| view_item | View of the product page | Comparing views against purchases |
| add_to_cart | Product added to the cart | Spotting the product pages that convince |
| begin_checkout | Checkout start | Measuring cart abandonment |
| add_shipping_info and add_payment_info | Shipping and payment steps | Finding the step where people leave |
| purchase | Completed purchase | Revenue, orders, and average order value |
| refund | Refund | Real net revenue |
This is what a purchase event sent with gtag.js looks like:
<script>
gtag("event", "purchase", {
transaction_id: "ORD-10482",
value: 179.98,
currency: "USD",
shipping: 9.99,
items: [
{
item_id: "RUN-W-07",
item_name: "Women's running shoes",
price: 89.99,
quantity: 2
}
]
});
</script>
Three details about GA4 ecommerce parameters prevent junk data: the transaction_id is required on purchases and refunds and must be unique per order; always send the currency along with the value; and each product needs at least item_id or item_name. The value is the sum of price times quantity of the products.
Consent Mode: measure while respecting the visitor's choice
Consent mode tells Google whether the visitor accepted or rejected cookies, so tags adjust their behavior. It doesn't include a banner: you need your own consent tool. According to the consent mode overview, the key types for a store are:
- analytics_storage: storage for analytics, like visit duration.
- ad_storage: advertising cookies or identifiers.
- ad_user_data: permission to send user data to Google for advertising purposes.
- ad_personalization: permission for personalized advertising.
There are two ways to implement it. In basic mode, tags don't load until the visitor responds and, if they reject, nothing is sent to Google. In advanced mode, tags load with consent denied by default and send cookieless pings that Google uses to model data.
Check with your legal advisor what the law requires where you sell. Either way, asking for consent clearly also builds trust with someone who's about to buy from you.
Check that everything works
- Open the Realtime report and browse your store in an incognito window: view a category, open a product, and add it to the cart.
- Use DebugView (under Admin) to see each event with its parameters.
- Place a test order and confirm that
purchasearrives only once, with the correcttransaction_id, value, and currency. - For a week, compare WooCommerce orders with purchases in GA4. A small difference is normal; a big one points to a problem.
The reports that matter for selling
- Traffic acquisition: which channels bring sessions that buy. Add revenue and key events as columns.
- Ecommerce purchases: items viewed, added to cart, and purchased, plus revenue per product excluding tax and shipping. Products with many views and few purchases are candidates for improving their product page and price.
- Funnel exploration: view_item → add_to_cart → begin_checkout → purchase. It shows you where people drop off and connects with your work on conversion rate, sales funnel, and abandoned cart recovery.
- Linked Search Console: you see Google searches next to behavior in your store. If you haven't set it up yet, start with the guide to Google Search Console.
Watch data retention: in standard properties you can choose 2 or 14 months, and that option only affects explorations and funnel reports, not standard reports, according to the Analytics help on data retention. Choose 14 months so you can compare seasons.
Common mistakes in stores
- Duplicate tag (plugin plus code in the theme): double sessions and purchases.
- Purchases recorded twice when the customer reloads the order received page and your implementation doesn't handle it.
- Gateways that don't return to the store: purchases aren't recorded.
- Payment gateways showing up as referral sites: add them to the unwanted referrals in the tag settings.
- Wrong currency in the property or internal traffic not excluded.
Once you're measuring properly, the next step is attracting more visits that buy: see how to increase organic traffic and how we approach WooCommerce SEO.
Conclusion: measure first, decide later
GA4 set up properly turns your store into a decision dashboard: which channel deserves more investment, which product page needs work, and at which checkout step you're losing money. Set up badly, it only gives you numbers nobody believes.
Your next step: create the property, install a single path for the tag, validate a test purchase, link Search Console, and set retention to 14 months. Then review the funnel once a month. Find more tools to measure your store in the SEO tools guides.
Frequently asked questions
What is Google Analytics and what is it for in an online store?
Google Analytics is Google's platform for measuring what visitors do on your site. In a store, it tells you which channels bring buyers, which products get viewed and sold, at which checkout step customers drop off, and how much revenue each campaign generates. Its current version, GA4, records every interaction as an event with parameters.
Is GA4 free?
Yes. The standard version of Google Analytics 4 is free and enough for most small and midsize stores. There's a paid version for large companies, Analytics 360, with more capacity and data retention options, but you don't need it to measure sales, funnels, and channels for a growing store.
How do I install Google Analytics on WordPress without coding?
Create a GA4 property with a web data stream and copy the measurement ID that starts with G-. In a WooCommerce store, install the free Google Analytics for WooCommerce extension and paste that ID under WooCommerce, Settings, Integration. If you only need the basic tag on WordPress, Google's Site Kit also connects Analytics. Use a single method so you don't duplicate data.
Why doesn't GA4 match my WooCommerce orders?
A small difference is normal: some visitors block scripts or reject cookies. Big differences are usually caused by duplicate tags, payment gateways that don't return to the order received page, or purchase events without a unique ID. Compare orders and purchases for a week and review your implementation if the gap is large.
What happens to measurement if the visitor rejects cookies?
It depends on how you implement consent mode. In basic mode, Google tags don't load until the visitor responds and, if they reject, nothing is sent. In advanced mode, tags load with consent denied and send cookieless pings that Google uses to model data. Either way, you need a consent banner.
Sources
Written and reviewed by the SEOXtreme editorial team using official sources (Google Search Central, platform documentation, and published studies). If you spot outdated information, email us at hola@vidaxtreme.com.