GuideUpdated October 30, 2026
GA4 ecommerce tracking for Shopify and WooCommerce
GA4 ecommerce tracking means sending Google's recommended ecommerce events, with the parameters each one needs. This guide covers which events to send, how to connect a Shopify or WooCommerce store, and how to check the events before you trust the numbers. To review a setup that already exists, use the GA4 audit checklist, which also covers property settings, key events and referrals.
Key points
- Use Google's recommended event names, from
view_item_listtopurchase, and senditemswith every one. - Send
valuewithcurrency, and count only price times quantity, without shipping or tax. - Give every
purchaseatransaction_idthat is unique to the order and never empty. - Use one setup per store: the Google & YouTube app or a custom pixel on Shopify, the Google Analytics for WooCommerce extension on WooCommerce.
- Check the events in DebugView before you trust the reports.
On this page
GA4 ecommerce events, step by step
Google's ecommerce guide gives each step of the shopping path its own recommended event. Use the names exactly as written. For a typical store, these eight cover the path from a collection page to a finished order:
- 1Collection or search page
view_item_list - 2Product page
view_item - 3Add to cart
add_to_cart - 4Open the cart
view_cart - 5Start checkout
begin_checkout - 6Shipping details
add_shipping_info - 7Payment details
add_payment_info - 8Order complete
purchase
Google's guide has a few more, for stores that need them:
| Event | When to send it |
|---|---|
select_item | Someone clicks a product in a list. |
remove_from_cart | A product comes out of the cart. |
refund | You refund an order. Send the same transaction_id as the purchase. |
view_promotion, select_promotion | A promotion is shown, or someone clicks it. |
add_to_wishlist | A product is added to a wishlist. |
Required parameters for GA4 ecommerce events
Google's recommended events reference lists the parameters for each event. These are the ones it marks as required:
| Parameter | Required on | What to send |
|---|---|---|
items | Every event from view_item_list to purchase | The products involved, up to 200 per event. What each item needs is in the next table. |
value | Every step in the diagram except view_item_list, plus remove_from_cart | The sum of price times quantity for all items, without shipping or tax. Google says it's typically required for meaningful reporting. |
currency | The same events, plus view_item_list | A 3-letter ISO 4217 code, such as USD or EUR. If you set value, currency is required for revenue metrics to be computed accurately. |
transaction_id | purchase and refund | The unique identifier of the transaction. Google says it helps you avoid duplicate events for a purchase. |
Inside items, each product needs an ID or a name:
| Item parameter | What Google says |
|---|---|
item_id, item_name | At least one of the two is required. Google recommends sending both. |
price | Optional. The unit price, in the event's currency. |
quantity | Optional. If you leave it out, it's set to 1. |
A few optional parameters are worth knowing:
| Optional parameter | On which events |
|---|---|
coupon | The checkout events and purchase |
shipping_tier | add_shipping_info |
payment_type | add_payment_info |
shipping, tax | purchase |
gtag('event', 'purchase', {
transaction_id: 'ORDER-1001',
value: 58.00,
currency: 'USD',
tax: 4.64,
shipping: 5.00,
items: [
{
item_id: 'SHIRT-BLUE-M',
item_name: 'Linen shirt',
price: 29.00,
quantity: 2,
},
],
});value is 2 × 29.00 = 58.00, and tax and shipping go in their own parameters.Shopify: connect GA4 with the Google & YouTube app
Shopify's GA4 page tells you to install the Google & YouTube sales channel and then follow Google's setup guide. You need a GA4 property with a web data stream first, and Shopify notes that creating one needs the editor role on the Google Analytics account.
- 1
Install the app
Sign in to Shopify and install the Google & YouTube app.
- 2
Start the GA4 setup
On the app's Overview page, find the "Just want to set up Google Analytics 4" section and click Get started.
- 3
Connect your property
Pick your GA4 property, click Connect, then Confirm. Google says this route is strongly preferred over adding the tag by hand in the app's settings.
You don't write event code. Google's Shopify event reference lists what the app sends: all eight events in the diagram, plus page_view and search. Of the extra events, it sends only remove_from_cart.
The app's purchase event carries the required parameters, plus tax, shipping and coupon. It also sends shopify_event_name, which you can use to build filters in GA4.
Don't send GA4 from two places
Use either this app or your own code in a custom pixel, described in the next section, so the same events aren't sent twice.
Shopify: send GA4 events from a custom pixel
If you'd rather send GA4 events yourself, for example through Google Tag Manager, Shopify's route is a custom pixel. Custom pixels run in a lax sandbox, and Shopify says not all pixel functionality works there. Shopify also says adding and using custom pixels is unsupported, so troubleshooting is on you.
- 1
Clear out existing pixels
Shopify says to remove or modify any existing pixels before you add a custom one, so customer events aren't counted twice. If the Google & YouTube app already sends GA4 events, a custom pixel would be a second sender.
- 2
Add the pixel
In Shopify admin, go to Settings → Customer events and add a custom pixel. Paste your code and save.
- 3
Connect it
Click Connect pixel. It doesn't track anything until it's connected.
Map Shopify events to GA4 events
Your code subscribes to Shopify's customer events and sends them on under GA4 names. Shopify's Google Tag Manager tutorial maps them like this:
| Shopify customer event | GA4 event |
|---|---|
collection_viewed | view_item_list |
product_viewed | view_item |
product_added_to_cart | add_to_cart |
product_removed_from_cart | remove_from_cart |
cart_viewed | view_cart |
checkout_started | begin_checkout |
checkout_address_info_submitted | add_shipping_info |
payment_info_submitted | add_payment_info |
checkout_completed | purchase |
When checkout_completed fires
Once per checkout, usually on the Thank you page. With a post-purchase upsell it fires on the first upsell page instead, and if that page fails to load it doesn't fire at all.
In the same tutorial, the purchase parameters come from these checkout fields:
| GA4 parameter | Shopify field in the tutorial |
|---|---|
transaction_id | checkout.order.id, which is only set on checkout_completed |
currency | checkout.currencyCode |
value | checkout.totalPrice.amount |
Decide which amount goes in value
Shopify defines totalPrice as including duties, taxes and discounts, and subtotalPrice as the price before duties, shipping and taxes. GA4's value leaves out shipping and tax, so check which field your pixel sends before you go live.
WooCommerce: Google Analytics for WooCommerce
WooCommerce's own extension for GA4 is Google Analytics for WooCommerce. Its documentation covers the setup:
- 1
Install the extension
Install and activate Google Analytics for WooCommerce.
- 2
Add your Measurement ID
Go to WooCommerce → Settings → Integration → Google Analytics and enter the ID that starts with G-.
- 3
Turn on the tracking options you need
They include purchase transactions, add to cart and remove from cart events, product impressions and clicks on listing pages, product detail views, and checkout process initiated.
Purchases need a redirect
Purchase tracking needs a payment gateway that redirects to the thank you / order received page after payment. Check that yours does before you rely on purchase numbers.
Remove any other Google Analytics plugin or code. The extension's FAQ says duplicate Google Analytics code causes a conflict in tracking.
On consent, the extension sets a default state that denies all parameters for visitors in the EEA. It has no cookie banner of its own but works with the WP Consent API. Your banner plugin has to update consent after a visitor agrees, or data won't reach Google Analytics.
Check GA4 ecommerce events in Realtime and DebugView
- 1
Look at Realtime
Open Reports → Realtime, which shows activity from the last 30 minutes. The Event count by event name card tells you whether events are arriving at all.
- 2
Turn on debug mode
Use Google Tag Assistant (tagassistant.google.com) or Tag Manager's preview mode, or add
debug_mode: trueto the gtag config command. To turn it off later, remove the parameter: setting it to false doesn't turn debug mode off. - 3
Open DebugView
Go to Admin → Data display → DebugView. The Seconds stream shows events from the last 60 seconds, and the Debug device selector lets you pick your own device.
- 4
Walk the shopping path
Go through a product page, add to cart, the cart and checkout. Each event should appear once, in order.
- 5
Read the parameters
Click an event to see its parameters, and compare them with the required parameters.
Nothing in DebugView?
Google says events won't show there if consent mode is in use and you haven't consented to analytics cookies, or if client-side privacy controls block them. Accept the banner yourself while you test.
Each platform has one more catch when you test:
| Platform | What to watch for |
|---|---|
| WooCommerce | The extension doesn't track page views for logged-in admins, so test while logged out. If standard reports stay empty, the documentation suggests waiting 24 hours or checking the real-time reports. |
| Shopify custom pixel | Tag Assistant's Troubleshoot tag feature doesn't work with custom pixels. Shopify recommends its Shopify Pixel Helper for checking that your events reach the sandbox without errors. |
Pixel Audit runs the same walk-through from our servers. It opens your store, goes through home, product, cart and checkout, and reports which GA4 events fired and with what parameters, along with seven other tags. It doesn't place an order, so it can't see purchase or Measurement Protocol events.
Common GA4 ecommerce tracking errors
| Problem | What to do |
|---|---|
| Two setups send GA4 events | Keep one. Shopify says to remove or modify existing pixels before adding a custom one, and WooCommerce's FAQ says duplicate Google Analytics code causes a conflict in tracking. |
No transaction_id | Add one: Google says ecommerce events need a transaction ID to deduplicate transactions from the same user and to process refunds properly. Deduplication only works on web streams, not app streams. |
Empty transaction_id | Pass a dynamic order number. Google says GA4 will deduplicate all purchase events sent with transaction_id="", so real orders go missing. |
| The same ID for different orders | Make it unique per order: Google warns a reused ID can significantly undercount key events. Don't reuse it across users or put anything in it that could identify the customer. |
value without currency | Send both. If you set value, currency is required for revenue metrics to be computed accurately. |
value includes shipping or tax | Set value to the sum of price times quantity for the items. Shipping and tax have their own parameters. |
Missing items, or items without an ID or name | Every event from view_item_list to purchase needs items. Each item needs an ID or a name, as in the item table. |
| Old data left in the data layer | With Google Tag Manager, Google's examples clear the previous ecommerce object with dataLayer.push({ ecommerce: null }) before pushing each new ecommerce event. |
| Testing as a logged-in WooCommerce admin | Log out or use an incognito window. The extension doesn't track admin visits, so you see nothing even when tracking works. |
See which GA4 ecommerce events fire on your product, cart and checkout pages, and with what parameters.
Questions
- Which events do I need for GA4 ecommerce tracking?
- One event for each step of the shopping path, from
view_item_liston a collection page topurchasewhen the order is complete. The first section lists all eight. Each one needsitems, andpurchasealso needstransaction_id. - Is there Enhanced Ecommerce in GA4?
- Enhanced Ecommerce was a Universal Analytics feature, and Google's help article on it is now marked legacy. Standard Universal Analytics properties stopped processing data on July 1, 2023. In GA4 you send the recommended ecommerce events described in this guide.
- Do I need to add GA4 code to Shopify if I use the Google & YouTube app?
- No. Google's Shopify event reference lists the events the app sends, from
view_item_listandview_itemthrough checkout topurchase. If you add your own GA4 code in a custom pixel as well, Shopify says to remove or modify existing pixels first so customer events aren't counted twice. - Why doesn't GA4 show purchases from my WooCommerce store?
- Check that purchase transactions are turned on in the extension, that your payment gateway redirects back to the order received page, and that you're testing while logged out. If you use a consent banner, data only reaches Google Analytics after the banner updates consent.
- Should the GA4 value parameter include shipping and tax?
- No. Google says
valueis the sum of price times quantity for all items, without shipping or tax. Thepurchaseevent has separateshippingandtaxparameters.
Related guides
Sources
- Google for Developers: Measure ecommerce (GA4)
- Google for Developers: Measure ecommerce with Tag Manager
- Google for Developers: Recommended events reference
- Analytics Help: Minimize duplicate key events with transaction IDs
- Analytics Help: Monitor events in DebugView
- Analytics Help: Realtime report
- Analytics Help: Google Analytics 4 has replaced Universal Analytics
- Analytics Help: About Enhanced Ecommerce (Universal Analytics, legacy)
- Google Ads Help: Shopify: Set up your Google tag
- Google for Developers: Shopify event parameters
- Shopify Help Center: Migrating to Google Analytics 4
- Shopify Help Center: Custom pixels
- Shopify Help Center: Manage your custom pixels
- Shopify Help Center: Create a Google Tag Manager custom pixel
- Shopify.dev: Standard events
- Shopify.dev: checkout_completed
- WooCommerce: Google Analytics for WooCommerce documentation
- WooCommerce on GitHub: Google Analytics for WooCommerce, consent mode
- WooCommerce on GitHub: Google Analytics for WooCommerce readme and FAQ