Skip to content

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_list to purchase, and send items with every one.
  • Send value with currency, and count only price times quantity, without shipping or tax.
  • Give every purchase a transaction_id that 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
  1. Ecommerce events
  2. Required parameters
  3. Shopify: Google & YouTube app
  4. Shopify: custom pixel
  5. WooCommerce
  6. Check your events
  7. Common errors
  8. Questions

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:

  1. 1Collection or search pageview_item_list
  2. 2Product pageview_item
  3. 3Add to cartadd_to_cart
  4. 4Open the cartview_cart
  5. 5Start checkoutbegin_checkout
  6. 6Shipping detailsadd_shipping_info
  7. 7Payment detailsadd_payment_info
  8. 8Order completepurchase
The shopping path and the recommended GA4 event for each step.

Google's guide has a few more, for stores that need them:

select_itemSomeone clicks a product in a list.
remove_from_cartA product comes out of the cart.
refundYou refund an order. Send the same transaction_id as the purchase.
view_promotion, select_promotionA promotion is shown, or someone clicks it.
add_to_wishlistA 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:

itemsEvery event from view_item_list to purchaseThe products involved, up to 200 per event. What each item needs is in the next table.
valueEvery step in the diagram except view_item_list, plus remove_from_cartThe sum of price times quantity for all items, without shipping or tax. Google says it's typically required for meaningful reporting.
currencyThe same events, plus view_item_listA 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_idpurchase and refundThe 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_id, item_nameAt least one of the two is required. Google recommends sending both.
priceOptional. The unit price, in the event's currency.
quantityOptional. If you leave it out, it's set to 1.

A few optional parameters are worth knowing:

couponThe checkout events and purchase
shipping_tieradd_shipping_info
payment_typeadd_payment_info
shipping, taxpurchase
js
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,
    },
  ],
});
A purchase of two shirts at 29.00 each: 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. 1

    Install the app

    Sign in to Shopify and install the Google & YouTube app.

  2. 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. 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.

Watch out:

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. 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. 2

    Add the pixel

    In Shopify admin, go to Settings → Customer events and add a custom pixel. Paste your code and save.

  3. 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:

collection_viewedview_item_list
product_viewedview_item
product_added_to_cartadd_to_cart
product_removed_from_cartremove_from_cart
cart_viewedview_cart
checkout_startedbegin_checkout
checkout_address_info_submittedadd_shipping_info
payment_info_submittedadd_payment_info
checkout_completedpurchase
Note:

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:

transaction_idcheckout.order.id, which is only set on checkout_completed
currencycheckout.currencyCode
valuecheckout.totalPrice.amount
Watch out:

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. 1

    Install the extension

    Install and activate Google Analytics for WooCommerce.

  2. 2

    Add your Measurement ID

    Go to WooCommerce → Settings → Integration → Google Analytics and enter the ID that starts with G-.

  3. 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.

Watch out:

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. 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. 2

    Turn on debug mode

    Use Google Tag Assistant (tagassistant.google.com) or Tag Manager's preview mode, or add debug_mode: true to the gtag config command. To turn it off later, remove the parameter: setting it to false doesn't turn debug mode off.

  3. 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. 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. 5

    Read the parameters

    Click an event to see its parameters, and compare them with the required parameters.

Watch out:

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:

WooCommerceThe 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 pixelTag 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

Two setups send GA4 eventsKeep 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_idAdd 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_idPass 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 ordersMake 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 currencySend both. If you set value, currency is required for revenue metrics to be computed accurately.
value includes shipping or taxSet 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 nameEvery 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 layerWith 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 adminLog 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.

3 free checks a day. You'll sign in or create an account first.

Questions

Which events do I need for GA4 ecommerce tracking?
One event for each step of the shopping path, from view_item_list on a collection page to purchase when the order is complete. The first section lists all eight. Each one needs items, and purchase also needs transaction_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_list and view_item through checkout to purchase. 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 value is the sum of price times quantity for all items, without shipping or tax. The purchase event has separate shipping and tax parameters.

Related guides

Sources

  1. Google for Developers: Measure ecommerce (GA4)
  2. Google for Developers: Measure ecommerce with Tag Manager
  3. Google for Developers: Recommended events reference
  4. Analytics Help: Minimize duplicate key events with transaction IDs
  5. Analytics Help: Monitor events in DebugView
  6. Analytics Help: Realtime report
  7. Analytics Help: Google Analytics 4 has replaced Universal Analytics
  8. Analytics Help: About Enhanced Ecommerce (Universal Analytics, legacy)
  9. Google Ads Help: Shopify: Set up your Google tag
  10. Google for Developers: Shopify event parameters
  11. Shopify Help Center: Migrating to Google Analytics 4
  12. Shopify Help Center: Custom pixels
  13. Shopify Help Center: Manage your custom pixels
  14. Shopify Help Center: Create a Google Tag Manager custom pixel
  15. Shopify.dev: Standard events
  16. Shopify.dev: checkout_completed
  17. WooCommerce: Google Analytics for WooCommerce documentation
  18. WooCommerce on GitHub: Google Analytics for WooCommerce, consent mode
  19. WooCommerce on GitHub: Google Analytics for WooCommerce readme and FAQ