Why Shopify and Magento Refunds Fail to Update GA4
Refunds and part cancellations happen in the store backend, so GA4 often misses them. How the refund event works and how to report net revenue.
The monthly board pack shows an incredible return on ad spend in Google Analytics 4. The marketing team is celebrating. The finance director, holding a ledger of processed returns and partial cancellations, knows the business actually lost money on those campaigns.
Analytics platforms are optimistic by default. They record the moment a customer promises to pay you. They rarely stick around to check if you actually kept the money.
When you run an eCommerce operation on Shopify or Magento, you are dealing with returns, out-of-stock partial cancellations, and restocking fees. If your tracking stops at the checkout page, GA4 will permanently assume every order was fulfilled perfectly.
We often find that standard GA4 setups fail to record these post-purchase realities. The result is a marketing dashboard that claims victory on gross revenue while the business struggles with net margin.
The mechanics of a missing refund
To understand why the data diverges, you have to look at where the events actually happen.
When a customer completes an order, they land on a "Thank You" page. Your browser executes a Google Tag Manager script, which pushes a purchase event to GA4 containing the transaction ID and the value of the goods.
Three days later, the customer emails your support desk to cancel one of the three items in their order. A customer service agent logs into the Shopify Admin panel or issues a Credit Memo in Magento to refund the £50 item.
The customer is not on your website. Their browser is not open. Google Tag Manager is not running.
Because the refund happens in the backend of your eCommerce platform, the standard GA4 web tags have no way to observe it. The platform issues the refund to the credit card, your finance software registers the liability, but GA4 remains completely blind to the event. It continues to report the original gross order value.
What it does to your commercial decisions
If your business has a 2% return rate, you might choose to ignore the discrepancy. If you operate in apparel, trade supplies with heavy restocking, or high-value B2B equipment, your return rate could be 20%.
The journey of a partial cancellation
| What the business does | What the finance system records | What GA4 reports |
|---|---|---|
| Customer buys three £100 trade supplies. | Logs a £300 pending transaction. | Records a £300 purchase event. |
| Customer cancels one £100 item before dispatch. | Issues a £100 refund. | (No web activity; event ignored). |
| Customer returns another £100 item a week later. | Issues a second £100 refund. | (No web activity; event ignored). |
| The commercial result | Net revenue of £100. | Gross revenue of £300. |
When your Google Ads bidding algorithm is fed £300 of revenue for a transaction that only yielded £100, it learns the wrong lesson. It assumes the keyword that generated that customer is three times more profitable than it actually is, and it will aggressively spend your budget to acquire more customers exactly like them.
You end up optimising your paid media to generate gross revenue that you never actually get to keep.
Consider a specialist supplier dealing with complex orders where out-of-stock partial cancellations are common.
Illustrative figures: The margin mismatch
| Customer Action | True Net Revenue | Finance Ledger | GA4 Revenue Reported |
|---|---|---|---|
| £5,000 order (Fulfilled) | £5,000 | £5,000 | £5,000 |
| £3,000 order (Fully Cancelled) | £0 | £0 | £3,000 |
| £4,000 order (Half Returned) | £2,000 | £2,000 | £4,000 |
| Monthly totals | £7,000 retained | £7,000 retained | £12,000 reported |
The marketing team reports £12,000 of pipeline generated by the new campaign. The finance team reports £7,000 in the bank. This gap causes endless arguments about the true value of the marketing budget.
How we bridge the gap to the backend
We check what happens all the way through your order lifecycle. If refunds and cancellations are breaking your ROI calculations, we investigate your eCommerce architecture and explain what needs changing.
The fix requires moving the tracking away from the customer's browser and into your server.
First, we instruct your developers to use the GA4 Measurement Protocol. Instead of relying on a web page to load, we configure Shopify Webhooks or a Magento Observer to listen for the exact moment a refund or credit memo is issued in the backend.
When the customer service agent clicks "Refund", your server sends a secure, invisible ping directly to Google's servers. This payload contains the original transaction ID and the specific items that were cancelled. GA4 processes this refund event and deducts the value from your net revenue reports.
Second, we address the ultimate goal: tracking net margin. Revenue is vanity; margin is sanity. GA4 does not track the Cost of Goods Sold (COGS) by default.
To fix this, we configure your data layer and server-side events to include a custom margin parameter with every item. If you sell a £100 tool that costs you £60 to acquire, we pass £40 into the margin parameter. We register this as a Custom Metric in GA4, allowing your marketing team to see the actual gross profit generated by a campaign, rather than just top-line revenue.
Finally, we establish the rules of engagement. While we can send refunds to GA4, the analytics platform will never perfectly match a double-entry accounting system. GA4 is built to evaluate marketing performance; your ERP is built for HMRC. We ensure your team uses GA4 to understand which channels drive the highest retained margin, while always relying on the backend ledger for official financial reporting.
The aim is straightforward. When you cancel an order, your advertising platforms must be told, so they stop spending your money trying to find another one just like it.
Frequently asked questions
Does the GA4 refund event delete the original purchase?
No. GA4 is an immutable ledger. It does not delete the original purchase event. Instead, it logs a new refund event with a negative impact on your net revenue calculations, provided you use the exact same transaction ID that was sent during the purchase.
Can we track partial refunds if a customer only returns one item?
Yes. The GA4 refund event accepts an items array. If a customer buys three items and returns one, your backend must send a refund event containing only the specific item ID, quantity, and value of the returned good. GA4 will deduct only that portion from the net revenue.
Why do some Shopify apps fail to send refunds to GA4?
Many basic tracking apps only install browser-side scripts. Because refunds happen in the Shopify Admin, browser scripts cannot see them. To track refunds, the app must have server-side capabilities (using Shopify Webhooks and the GA4 Measurement Protocol).
Should we upload our COGS data into GA4?
You can pass COGS as a custom parameter on the purchase event, but be cautious with B2B pricing. If your data layer exposes your wholesale cost prices in the browser source code, competitors can read it. It is much safer to enrich the data server-side or calculate margin after the fact in BigQuery.
Why do my Google Ads still look too profitable?
Even if you send a refund event to GA4, Google Ads does not automatically retract the conversion value from its bidding algorithm unless you explicitly set up conversion adjustments or use offline conversion tracking to update the specific Click ID. GA4 reporting and Google Ads bidding are two separate systems.