How we track refunds in Segment and Google Analytics

Updated on 2023-04-18

Littledata integrates marketing channel data with browsing and purchase events for Shopify sites. To ensure complete, accurate data, we track post-purchase upsells in the Shopify checkout, as well as additional post-purchase events such as recurring orders (subscriptions), cancellations and refunds.

This article explains what we do - and do not - track in terms of refunds and returns. It also explains how to view refund data in Segment and Google Analytics, including GA4.

What is a refund event?

The refund event triggers when a customer is unhappy with what they have ordered and wants a refund. After you confirm and accept the refund, clicking the Refund button in the Shopify Admin triggers a Refund event in the destinations that you have connected.

Once you hit the Refund button, our app fetches the information we need to build the Refund event.

Here is how the order information is fetched so that the refund event includes the matching order information:

Tracking Shopify refunds in Google Analytics

Returns vs Refunds

If you are using an app that has access to refunds, be aware that it may be not be triggering Littledata’s refund logic. Example return apps are:

  • Returnly
  • AfterShip
  • Refund Logic

These apps allow customers to exchange products for store credit or other products. Shopify sees this as an order edit not a refund (i.e. product A is swapped for product B). Therefore, no refund event is sent to any destination.

Only if the value or partial value is refunded to the customer will a return result in a refund.

Refunds in Google Analytics

In GA4, you can create an exploration with the refunds metric and you will have an overview of your refund orders.

How to see refunds in GA4

Refunds in Segment

In Segment, refunds will be found in your connected source debugger, by clicking the "Order Refunded" event.

How to see refunds in Segment

Attribution for refund orders

Source/Medium may change: the Source and Medium dimensions of the refund data will reflect the campaign attribution and date used in the customer's last session. These may be different than the original transaction data.

Example: you have a transaction attributed to google/cpc from customer A on date 1. That customer then has a later session on date 2, attributed to google/organic. If you refund the original transaction, the refund data will be attributed to the most recent Source/Medium, which would be, google/organic, and the date will be set to the day the refund is uploaded.

Why net revenue might be different in Google Analytics vs Shopify

Google Analytics adds the refund to the date of the order, whilst Shopify will add it to the date of the refund. This will cause expected discrepancies between the Net Revenue reported by the two tools.

Supported refund types

Littledata supports all refund types that happen on your Shopify store:

Full Refunds

A full refund happens when you refund an entire order.

Littledata will send a refund event containing all the products the customer wanted to refund, with all the correct information and parameters (clientIDs, shipping cost, etc.).

Partial Refunds

A partial refund happens when a customer wants to refund only one or two items from the order (e.g. 3 out of 5).

Littledata will send a refund event containing only the products the customer wanted to refund, with all the correct information and parameters (clientIDs, shipping cost, etc.).

Custom Refunds

A custom refund happens when you refund the customer for a specific amount.

Littledata will send a Refund event containing NO products, but only the amount refunded to your customer.

DestinationFull refundPartial refundCustom refund
Universal Analytics
Google Analytics 4
Segment
Facebook Conversions API❌❌

* Facebook does not have a predefined event for refunds

Refunds with multi-currency

If your store supports multi-currency, then the refunds will be send in the currency presented to the customers.

What this means is that when you refund an order, the refund event sent by Littledata will have its values updated to match the store currency AND the presentment amount.

Multi-currency refunds in Google Analytics

Above you can see how the Shopify shows the order before it is refunded, and below the order refunded, with the presentment money value.

How it looks in Shopify

Edge cases

Littledata stores the orders for seven days, as a cache for refund information and parameters.

If a refund is placed and we do not have the order in the database, we'll get the order information through an API call to Shopify. (If the order is not older than 60 days)

If the refund takes place more than 60 days after the original order was placed, we'd have no way of collecting the order information and passing that through to Google Analytics.

Learn more