Analytics

How to track Shopify refunds in GA4

Why GA4 misses Shopify refunds, how a refund event reaches GA4 server-side, a worked partial refund, and why GA4 refunds never match Shopify exactly.

·7 min read·By the ROASaurus team

Key takeaways
  • GA4 does not see Shopify refunds by itself: they happen in the admin, where no GA4 tag runs.
  • A refund reaches GA4 as a refund event with the same transaction_id as the purchase, sent from a server through the Measurement Protocol.
  • GA4 subtracts refunds from purchase revenue; with refunded items in the event, it also subtracts them from item revenue.
  • The Measurement Protocol only accepts events up to 72 hours old, so refunds have to be sent close to when they happen.
  • GA4 and Shopify will still differ on refunds: dates, tax and shipping, exchanges and purchases GA4 never received.

To track Shopify refunds in GA4, each refund has to be sent to GA4 as a refund event, with the same transaction_id as the original purchase, from a server through the Measurement Protocol. GA4 then subtracts the refunded value from purchase revenue. Without that event, GA4 never learns about the refund, and its revenue stays at what was ordered, not what you kept.

This guide explains why GA4 misses refunds, what a correct refund event contains, how a partial refund flows from Shopify to GA4 with numbers, how to check it, and why the two systems will still not match to the cent.

Why GA4 misses refunds by default

GA4's tag runs in the shopper's browser, on your storefront and checkout. A refund happens somewhere else: you or a returns app create it in the Shopify admin, often days or weeks after the order. There is no page view and no browser in which a tag could fire.

Google's ecommerce documentation describes the fix: measure refunds by sending a refund event with the transaction id of the purchase, and include the refunded items to get item-level refund metrics. Because the refund happens outside the browser, that event has to come from a server, which is what the Measurement Protocol is for.

The cost of skipping it depends on your return rate. A store selling clothing, with many returned sizes, can see GA4 revenue well above what it keeps, and every ROAS calculated from GA4 revenue is too high by the same share.

Refunds and exchanges: what gets tracked

What happens in ShopifyMoney back?What GA4 should receive
Full refundYes, allA refund event for the whole order
Partial refund of some itemsYes, partA refund event with the refunded items and their value
Exchange for the same priceNoNothing: revenue is unchanged
Exchange for a cheaper itemYes, the differenceA refund event for the difference
Cancelled order with a refundYesA refund event; the purchase stays counted
GA4 only knows refunds. Returns that keep the money in the store do not lower GA4 revenue, so GA4 refund counts are lower than Shopify return counts.

How a refund reaches GA4

Shopify adminYou refund one item of order #2207
WebhookShopify reports the refund to your server or app
Refund eventtransaction_id 2207, value, currency, items
Measurement ProtocolSent to GA4 within 72 hours
GA4Purchase revenue of the transaction goes down
The path of a refund. Every step needs the same transaction id the purchase used.
  1. Catch the refund

    Shopify sends a refunds/create webhook when a refund is created. A server-side tool, or your own code, listens for it.

  2. Find the transaction id

    Use exactly the transaction_id the purchase was sent with: the Shopify order id, the order name or the order number, depending on your setup. A different format means GA4 cannot match the refund.

  3. Build the event

    Set value to the refunded amount without tax, currency in ISO 4217, and items with item_id, price and quantity of the refunded lines. Google says value should not include tax or shipping.

  4. Send it with the right ids

    Post the event to the Measurement Protocol with your measurement id and API secret, and a client id. The protocol accepts events up to 72 hours old.

  5. Wait for processing

    Like any GA4 data, the refund can take 24 to 48 hours to appear in reports.

Worked example: a partial refund from Shopify to GA4

An example order, #2207, with US sales tax:

LineAmount
Summer dress, 1 × $80$80.00
Leather belt, 2 × $20$40.00
Items$120.00
Shipping$5.00
Sales tax, 8% of items$9.60
Order total$134.60
Example order. The purchase reaches GA4 with value 120.00, without tax and shipping, as Google asks.

The customer sends one belt back. You refund it in Shopify: $20 plus $1.60 of tax, $21.60 in total. The refund event and the result in GA4:

refund transaction_id=2207Same id as the purchase
value=20.00 currency=USDRefunded amount without tax
items=[{item_id: belt-brown, price: 20, quantity: 1}]The refunded line
purchase revenue 2207: 120.00 → 100.00Result in GA4 after processing
Example data.
GA4 metric for transaction 2207Before the refundAfter the refund
Gross purchase revenue$120.00$120.00
Refund amount$0.00$20.00
Purchase revenue$120.00$100.00
Item revenue (belt)$40.00$20.00
Purchase revenue is gross purchase revenue minus refunds. Item revenue only drops because the event lists the belt.

A checklist for matching GA4 refunds to Shopify

  1. Same transaction id

    In Explore, build a free-form table with Transaction ID as the row and Gross purchase revenue, Refund amount and Purchase revenue as values. Search for the order. If the purchase is not there, there is nothing for the refund to reduce.

  2. Timing

    Note when you created the refund and compare a date range that covers a few days after it, not a single day.

  3. Currency

    A refund in a different currency than the purchase is converted at another day's rate, so a full refund may not cancel the purchase to the cent.

  4. What value contains

    Check whether your purchase value includes tax and shipping and whether your refund value does. If they differ, refunded transactions keep a remainder.

  5. Delivery versus result

    A refund event that was delivered is not the same as a transaction whose revenue went down. Check both: the log of your tool, then the transaction in GA4.

Why GA4 refund reports won't match Shopify exactly

  • Different days. GA4 records the refund on the date of the refund event, and processes it a day or two later. Shopify reports refunds on the day they were created. Neither moves the refund back to the order date.
  • Different values. Shopify's refund includes tax and sometimes shipping or adjustments; the GA4 event follows your tool's rules.
  • Missing purchases. Orders GA4 never received, because of ad blockers, consent choices, draft orders or other sales channels, cannot be reduced.
  • Exchanges. They are returns in Shopify but not refunds in GA4, unless money goes back.
  • Old refunds. The Measurement Protocol does not accept events older than 72 hours, so refunds from before the setup cannot be sent.

The wider gap between the two systems is covered in GA4 vs Shopify revenue.

What you can see in GA4 once refunds flow in

  • Refund amount and item refund amount as metrics in explorations, next to gross purchase revenue and gross item revenue.
  • Purchase revenue and item revenue net of refunds in every report that uses them, including the acquisition reports.
  • Refund rate by channel or campaign, as refund amount divided by gross purchase revenue, in an exploration with Session default channel group or Session campaign as the row.
  • Products that come back, from item refund amount per item name.

One trap: GA4's Transactions metric counts refund events as transactions too. Use Ecommerce purchases to count orders. Refund data in GA4 is useful for marketing analysis; for what your store actually kept after refunds, costs and fees, use your store's numbers, as described in Shopify profit tracking.

How ROASaurus sends Shopify refunds to GA4

Install the ROASaurus Shopify app and add GA4 as a destination under Connections › Tracking & destinations, with your measurement id and a Measurement Protocol API secret. Purchases and refunds are the two events the GA4 destination has ticked by default.

Part of the refund eventWhat ROASaurus sends
TriggerShopify's refunds/create webhook, for every refund of a tracked order
transaction_idThe Shopify order id, the same as on the purchase ROASaurus sent
valueThe refunded amount without tax: the refunded items, plus refunded shipping when you refund it
currencyThe same as the purchase
itemsThe refunded lines with item_id, item_name, price and quantity
TimestampThe time of the refund, so GA4 records it on the day it happened
Identity and consentTaken from the order's purchase: without consent, no user data and no browser ids
The refund event of the ROASaurus GA4 destination. Refunds more than 72 hours old are skipped, because the Measurement Protocol does not accept them.

Each delivery appears under Data quality › Deliveries with its status and GA4's response, so you can check delivery before you check the result in GA4. Test mode sends events to GA4's validation server, which checks them without recording anything.

ROASaurus also counts refunds in its own reports, on the day they happened: net revenue, profit per order and product, and ROAS and POAS after refunds, without depending on GA4. Before peak season, the BFCM tracking checklist includes refunds; email platforms handle refunds differently again, see the Klaviyo and Shopify tracking guide. How the server-side delivery works is on the server-side tracking page and in what server-side tracking is.

Sources

  1. Google Analytics for developers: Measure ecommerce (refunds)
  2. Google Analytics for developers: Recommended events reference (refund)
  3. Google Analytics for developers: Send Measurement Protocol events
  4. Google Analytics Data API: API dimensions and metrics (refundAmount, transactions)

In ROASaurus

Keep reading

MarketingBFCM tracking checklist: can you trust your ad results?A Black Friday tracking checklist: test a real purchase, find duplicate conversions, choose which orders count, check consent and judge ads on profit.MarketingHow the Klaviyo Shopify integration tracks eventsHow Klaviyo collects Shopify data: order events, Checkout Started, onsite events, how it identifies visitors, where coverage ends and how to set it up.TrackingWhy GA4 revenue does not match ShopifyGA4 revenue is lower than Shopify for two reasons: different definitions and purchases GA4 never received. How to tell them apart and close the gap.

FAQ

Questions, answered

More answers in the FAQ and the help center.

Does GA4 track Shopify refunds automatically?

No. Refunds are created in the Shopify admin, where GA4's tag does not run. A refund event with the purchase's transaction id has to be sent from a server through the Measurement Protocol.

How long does a refund take to show in GA4?

GA4 needs 24 to 48 hours to process events, plus whatever delay your tool has before it sends the refund. Check a date range a few days after the refund.

Should the refund value include tax and shipping?

Google says the value of a refund event should not include tax or shipping, the same rule as for purchases. Keep the purchase and refund rules consistent, or refunded orders will leave a remainder in GA4.

Why does a fully refunded order still show revenue in GA4?

Usually because the purchase value included tax and shipping while the refund value did not, or because the refund was in a different currency. A refund with a wrong transaction id does not reduce the order at all.

Can I send old Shopify refunds to GA4?

Not through the Measurement Protocol, which only accepts events up to 72 hours old. Refunds from before your setup stay out of GA4.

Do exchanges count as refunds in GA4?

No. An exchange without money back is not a refund. Only an exchange that refunds a price difference should send a refund event, for that difference.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. Free plan, no credit card.