Quadro Design
Back to Insights

GA4 eCommerce Tracking in Shop-Script: Purchases, Refunds and a Trustworthy Audit

When an online shop says it made 40 sales but its analytics report shows 33 purchases, the immediate temptation is to add another tracking plugin. That can make the discrepancy worse. Reliable eCommerce measurement starts with understanding order states, event ownership, currency, privacy...

GA4 eCommerce Tracking in Shop-Script: Purchases, Refunds and a Trustworthy Audit

When an online shop says it made 40 sales but its analytics report shows 33 purchases, the immediate temptation is to add another tracking plugin. That can make the discrepancy worse. Reliable eCommerce measurement starts with understanding order states, event ownership, currency, privacy choices and returns. This practical guide is for teams using Webasyst Shop-Script or comparable catalogue platforms in 2026. It focuses on an auditable purchase trail rather than optimistic revenue promises.

Why the sales dashboard and analytics rarely agree

A Shop-Script order, a payment gateway settlement and a Google Analytics 4 purchase event describe different moments in the same journey. The order system records commercial obligations; the gateway tracks authorisation, capture and refund; analytics measures eligible interactions. Comparing their headline totals without specifying status, date range, time zone, tax treatment, currencies and consent is misleading. An order awaiting bank transfer should not automatically become a completed online purchase just because the customer reached a thank-you page. Equally, an accepted payment may not be visible in analytics when tracking was declined or blocked. Start by writing down what each figure actually means before changing a tag.

Choose a small event contract

Google's current GA4 ecommerce measurement guide documents events for viewing products, adding items to a cart, beginning checkout, purchasing and issuing refunds. You do not need every optional interaction on day one. Select a limited journey such as view_item, add_to_cart, begin_checkout and purchase. Specify the page or verified business event that triggers each signal, the responsible component, the expected parameters, and who checks its accuracy. Avoid attaching purchase to a generic button click: an attempted payment, a return from an external gateway and a successful capture can occur in different orders. Record which outcome your business calls a sale and which state is only pending.

Keep product IDs stable across the journey

Choose identifiers that can be traced from the Shop-Script catalogue through the selected SKU, basket, checkout and order record. For a product with colour or size options, the parent product ID alone may not tell the team which variant was actually purchased. Map item_id to a stable, documented identifier, and if variants matter include item_variant or another prescribed attribute where available. Never invent a manufacturer part number from an image. In a used-parts store, one physical component might have a unique warehouse unit and a separate OEM reference; decide which is the analytics item identifier and retain the other in your internal inventory. The Google item parameter examples show item_id or item_name and optional fields such as price and quantity. The implementation should send the same identities through all relevant events.

Define purchase value and transaction ID precisely

The purchase payload needs an actual transaction_id and a defensible value and currency. Google's official examples treat value as the sum of item price multiplied by quantity, with tax and shipping represented separately; the report must not silently mix that amount with the order's charged grand total. Document treatment of discounts, shipping, tax and gift cards. For multi-currency stores, send the transaction currency correctly rather than applying a local accounting conversion inside the browser. Use a stable, unique transaction identifier that the merchant can reconcile with a genuine order without exposing customer details. Do not use an email address as an ID. An example test order might be named TEST-204, but real IDs must follow your live ordering policy.

Prevent double counting at the source

A customer may reload the confirmation page, return via a gateway, reopen an order link or trigger a delayed callback. A theme plugin and a marketing plugin may each send purchase. Build a single, documented owner of the purchase signal. Keep a server-side record of whether a transaction has already been made eligible for measurement, with sensible handling for failures and permitted retries. Google's ecommerce validation guide explains duplicate transaction-ID behaviour and warns about overlapping gtag.js and Tag Manager installations. Those platform safeguards do not replace application-level idempotency. In particular, do not assume a generic duplicate order webhook can simply be forwarded to analytics without checking the transaction state first.

Handle partial refunds and cancellations honestly

A cancellation is not necessarily a refund. A refund request is not the same as funds returned. Map the operational sequence separately: cancelled before payment, paid then cancelled, partly refunded after dispatch, and returned item with a final refund. The GA4 refund documentation describes a refund event associated with a transaction_id and recommends item-level details to report returned products. Only send a refund when the business record confirms the appropriate refund state and make sure a repeated notification does not become an additional refund. Decide how to distinguish multiple legitimate partial refunds and document how reconciliation will work. Use a test case containing two products with a refund for only one of them.

Respect consent instead of hiding the numbers

Before choosing a tracking pattern, inspect the storefront's cookie choices and the actual traffic regions. Google's consent mode implementation guide explains default consent states, updates following user choices and different behaviour of tags under basic and advanced implementations. Consent mode does not itself obtain valid permission and is not a legal compliance certificate. The right policy depends on the business and the applicable rules. A visitor who rejects analytics may not appear as an individually observed purchase in the same way as a consenting visitor; do not fill that gap by secretly replaying their interactions or attaching private order details. Explain to stakeholders why financial reports and consent-aware behavioural measurement answer different questions.

Test from product page to verified payment

Build a staging matrix with clear expected events: product view without checkout, a quantity change, cart abandonment, failed payment, successful payment, a refreshed success page, delayed gateway callback, a manual order adjustment and a refund. For each row note Shop-Script order status, gateway outcome, GA4 event name, transaction_id, currency, item quantities and expected count. Run with test payment credentials and anonymised products, not live customer details. Google's DebugView validation workflow explains how to inspect ecommerce events and item parameters; check the browser's tag requests too. A visible event in a preview is not proof that all fields are correct. In production, repeat a tightly controlled smoke test after deploying changes to checkout, consent, themes or payment plugins.

Measure useful decisions, not a perfect-looking dashboard

Review a regular sample of real orders with an agreed date range and currency. Compare purchase event counts, transaction IDs where available, values and refunds against the merchant's confirmed order register. Categorise differences: non-consenting sessions, offline payment, gateway delays, failed events, testing traffic, duplicate tags, mismatched time zones and later returns. Do not force two systems into fake equality by altering the order data. Track conversion trends alongside mobile journey errors and customer support complaints. Store only the minimum diagnostic details and limit access to exports. A credible small dashboard with an explanation of gaps is more valuable than a large dashboard nobody trusts.

When to configure an extension and when to build

For a straightforward store with one checkout and a reliable analytics extension, configuration and a focused audit may be sufficient. More complex Shop-Script setups with custom checkout steps, several gateways, asynchronous confirmations, subscriptions, offline payment or multiple storefronts may require a dedicated integration. Before commissioning development, ask who owns the event contract, what happens when a request fails, how refunds are sent, whether consent states are respected and how releases are tested. Avoid promising that a plugin alone will solve attribution or recover every untracked transaction. Start with the transaction lifecycle and acceptance scenarios, then decide on the technology.

A practical way to begin

Choose ten representative test purchases, including a failed payment, a reload and a partial refund. Write the expected order and analytics outcomes before looking at reports. Fix the largest mismatch, repeat the tests and document the result for the next release. For teams building or improving Shop-Script storefronts, Quadro Design's eCommerce development service can provide the context for discussing checkout architecture and measurement requirements. Bring a sample event map and anonymised examples rather than sharing real customers' payment or personal information.

Need a store that is easier to use and easier to grow?

We design eCommerce websites with clearer structure, better product presentation, and stronger foundations for search, marketplaces, and long-term scale.

Request a Quote View Services

Request a Quote

Send Products for Review

Upload 2-5 product samples and we'll prepare a free listing preview.

No file selected

Discuss Your Project

Tell us a bit about your project and we'll get in touch to discuss the details.