GA4 ecommerce tracking from product view to purchase

GA4 ecommerce tracking means sending the recommended ecommerce events to Google Analytics 4, from product view through the basket to purchase, with the correct items, value and currency. The data comes from the shop's data layer, which looks different on Shoptet and on WooCommerce, and the result is checked with a test order.

This text was written with the help of artificial intelligence. Statements about platforms are based on the official documentation linked in the article. Tomáš Hanus is responsible for the content, webrocks.cz@gmail.com.

Who it is for
For owners of a Shoptet or WooCommerce shop who want to see purchases, revenue and products sold in GA4 and be able to trust those numbers.
What you get
Configured GA4 ecommerce events, a written definition of order value and a record of a test order showing exactly what was sent to GA4.
Price
  • Tracking: Scope-based

Indicative, based on the pricing. The price depends on scope; webrocks prepares a specific offer based on your brief.

Send an inquiry

What GA4 ecommerce tracking is and when it makes sense

GA4 ecommerce tracking means a shop sends Google Analytics 4 events about what customers do with products: view, add to basket, check out, pay. Each event carries items, value and currency, so GA4 shows revenue, products sold and where people drop out.

Google recommends a set of ecommerce events, mainly these:

  • view_item_list and select_item: product listing and product click,
  • view_item: product detail,
  • add_to_cart, remove_from_cart and view_cart: the basket,
  • begin_checkout, add_shipping_info and add_payment_info: checkout steps,
  • purchase: a completed order,
  • refund: money returned for a whole order or part of it.

The full list with parameters is in Google’s GA4 ecommerce documentation. It pays off once you want to know which products get viewed but not bought, and where people drop out of checkout. GA4 itself and the Google Tag Manager (GTM) container are covered under setting up GA4 and Google Tag Manager.

Who it suits and who it does not

It suits you if:

  • your Shoptet or WooCommerce shop shows no purchases in GA4, or you do not trust them,
  • GA4 revenue differs from the shop admin more than you can explain,
  • tracking was added several times (integration, plugin, theme code) and nobody knows which counts.

It does not suit you if you expect GA4 to match your accounting exactly; browser-based tracking cannot deliver that, for the reasons below. Sending purchases to ad platforms is covered under Google Ads conversion tracking.

How the work goes

  1. Current state. A review of what already tracks the shop (integration, plugins, GTM, theme code) and what is sent twice.
  2. Data decisions. Agreeing the events and what order value means: VAT, shipping, discounts.
  3. Data layer. The data layer (dataLayer) is a page object from which tags read product and order details. Gaps in what the shop provides are filled.
  4. Events in GTM. GA4 events with items, value, currency and, for purchases, transaction_id, checked in GTM preview mode.
  5. Checking with a test order. What was sent to GA4 is compared with the shop admin.
  6. Publishing. Changes go live as a new container version; the previous version can be republished.

What you get

  • a description of tracked events and their parameters,
  • a written definition of order value: what is in and what is out,
  • configured and published GA4 events,
  • a record of the test order: what was sent to GA4 and how it matches the admin,
  • a list of duplicate tracking switched off, if any.

webrocks also brings experience with ecommerce data from developing JavaScript libraries for collecting it.

Shoptet and WooCommerce: where the data comes from

Shoptet

According to Shoptet’s help centre, Shoptet’s native GA4 integration (Propojení → Google → Analytics) works only on your own domain. According to the same page, for VAT payers it sends revenue excluding VAT, shipping and payment fees; shipping and payment go separately, including VAT.

For GTM, Shoptet fills the data layer itself, in its own format: the dataLayer[0].shoptet object with page type, currency, basket, product and, on the thank-you page, the order with number, prices with and without VAT, shipping and items (developer documentation). The same documentation describes the getShoptetDataLayer() helper and the ShoptetDataLayerUpdated event, fired for example after adding to the basket.

Whether Shoptet also pushes standard GA4 events in the ecommerce.items format is not described in the official documentation. It is checked on the shop; missing events are built from the shoptet object. Shoptet in its help centre warns against duplicate tracking via the integration, HTML code and GTM, and recommends one method.

The look of the shop is handled by Shoptet theme customisation.

WooCommerce

WooCommerce does not provide a data layer for GTM on its own. It can be added, for example, with the GTM4WP plugin, which according to its description pushes ecommerce events in GA4 format and can set the default Consent Mode v2 state. The other route is a custom data layer in code.

Mind the names. Google for WooCommerce mainly connects Google Merchant Center and campaigns, with a Google Ads conversion tag. GA4 has a separate plugin, Google Analytics for WooCommerce. With several such plugins plus GTM on one shop, the same purchase is easily sent twice.

The look of the basket and checkout is handled by WooCommerce customisation.

What to watch out for

Order value is a decision

Google’s documentation does not prescribe whether value includes VAT, shipping and discounts. Its sample code calculates value as the sum of price × quantity across items and sends tax and shipping separately in tax and shipping. The decision is yours, but it must hold everywhere: GA4, ad platforms, reports. According to the events reference, whenever value is sent, currency must be too, or revenue is not calculated correctly.

Duplicate purchases and transaction_id

According to Google Ads Help, refreshing or revisiting the thank-you page can fire a conversion tag again, and purchase can be sent again the same way. GA4 deduplicates purchases with the same transaction_id, but only for web data, not apps (GA4 help). Each order needs its own ID, typically the order number. An empty ID is an error: GA4 merges all purchases with an empty transaction_id into one. The ID should not identify the customer.

Other common mistakes

  • Missing ecommerce: null. Google’s GTM sample code clears the previous ecommerce object before every event; without it, items from the previous event can mix in.
  • Overwritten data layer. According to the data layer documentation, window.dataLayer is created as high as possible and never reassigned, or tags may not fire.
  • Items without identification. Every item in items needs at least item_id or item_name.
  • Tracking regardless of consent. What may be sent after the cookie banner choice is handled by Consent Mode v2.

Why GA4 revenue does not match the shop admin

GA4 measures in the browser, the admin counts orders in a database. A difference is normal if it is explainable. Common causes:

  • Cookie consent. A customer who declines tracking is missing from GA4, or appears only as cookieless measurement, depending on the Consent Mode setup.
  • Blockers. Ad blockers with filter lists such as EasyPrivacy remove tracking scripts. A purchase by a visitor whose tracking never loads is missing from GA4.
  • Duplicates. A purchase sent twice by two parallel setups inflates revenue.
  • Refunds. Without the refund event (with transaction_id, plus items for a partial refund) GA4 keeps counting returned orders.
  • A different value definition. The admin shows prices with VAT and shipping, GA4 perhaps without.

The goal is not zero difference, but a stable one you understand.

How much ecommerce tracking costs

The price list shows tracking as scope-based, with an indicative hourly rate from 500 CZK/hr. The price depends on the scope and complexity of the project.

The price goes down with:

  • a working GA4 base needing only basket and purchase,
  • one currency and one language version,
  • a data layer that already holds the data.

The price goes up with:

  • cleaning up after several parallel setups,
  • the full funnel from listings to payment and refunds,
  • several currencies, language versions or domains,
  • a custom data layer where the shop provides none.

Tell webrocks via the contact form which platform the shop runs on and what it tracks today. You will get a reply within 24 hours.

Frequently asked questions

Which ecommerce events should a shop track?

The core is view_item, add_to_cart, begin_checkout and purchase, plus listings, checkout steps and refund as needed. Add more only if you will analyse them.

Why does GA4 revenue not match the shop admin?

Consent, blockers, duplicates, refunds and value definition. A small, stable gap is normal; a large or fluctuating one signals an error.

Is a plugin needed?

Not on Shoptet, which fills the data layer itself. WooCommerce needs a plugin or custom code, GTM4WP for example. What matters is a single source of purchases.

How do I check tracking with a test order?

In GTM preview mode, go from product page to thank-you page and check transaction_id, value, currency and items on purchase. Compare value with the admin, then refresh the thank-you page: GA4 should show the order once.

Should order value include VAT and shipping?

Without them it is closer to what the shop earns; with them it is easier to compare with admin turnover. According to Shoptet’s help centre, Shoptet’s native integration sends value without VAT, shipping and payment fees for VAT payers. The main thing is to pick one definition and apply it everywhere.

Sources

  1. Google for Developers: Measure ecommerce
  2. Tag Manager Help: Preview and debug containers
  3. Tag Manager Help: Publishing, versions, and approvals
  4. Shoptet Help (Czech): Google Analytics setup
  5. Shoptet Developers: Data Layer
  6. WordPress.org: GTM4WP plugin
  7. WooCommerce: Google for WooCommerce Documentation
  8. WordPress.org: Google Analytics for WooCommerce plugin
  9. Google for Developers: Recommended events
  10. Google Ads Help: Use a transaction ID to minimize duplicate conversions
  11. Analytics Help: Minimize duplicate key events with transaction IDs
  12. Google for Developers: Measure ecommerce (Tag Manager)
  13. Google for Developers: The data layer
  14. EasyList: Overview (EasyPrivacy)
  • GA4 and GTM

    Google Tag Manager, GA4 and dataLayer setup for website tracking: custom events, verification in preview mode and an audit of existing tracking.

  • Google Ads conversions

    Google Ads conversion actions with the right value, no duplicates and enhanced conversions from data the customer entered.

  • Shoptet customisation

    Changes to the look and behaviour of a Shoptet store using custom CSS and JavaScript, with a live preview link before anything goes live.

All services