# How we track refunds in Segment and Google Analytics

Littledata integrates marketing channel data with browsing and purchase events for Shopify sites. To ensure complete, accurate data, we track [post-purchase upsells](/shopify/tracking-post-purchase-upsells-in-the-shopify-checkout.md) in the Shopify checkout, as well as additional post-purchase events such as [recurring orders (subscriptions)](/shopify/tracking-subscription-orders-in-the-shopify-checkout.md), 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 Analytics4.

## 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.

H﻿ere is how the order information is fetched so that the refund event includes the matching order information:

![Tracking Shopify refunds in Google Analytics](/files/jurG7Bs8A7KSn5vLUYIC)

## 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 4

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

{% hint style="info" %}
[See how you can build a Sales Performance report in GA4.](/google-analytics/conversions/how-to-build-a-sales-performance-report-in-ga4.md)
{% endhint %}

![How to see refunds in GA4](/files/v6jYoz60VDmG6n35yKN6)

## 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](/files/LkAHCZfjkwhutp2d1zDh)

## Attribution for refund orders

***Source/Medium*****&#x20;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 4 vs Shopify

Google Analytics 4 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.

| **Destination**              | F﻿ull refund | P﻿artial refund | C﻿ustom refund |
| ---------------------------- | ------------ | --------------- | -------------- |
| **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](https://www.littledata.io/multi-currency-for-shopify), 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](/files/25DmAQZpRKRDuCPvyXn1)

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](/files/rhw2sN6DeYhGRqtybzej)

## 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.

## Opting out of refund events

With Littledata, you have the ability to customise your events and this also applies to refund events. If you wish to not track refunds, you can do so by going to your litteldata app, choose your desired connection and untick the event.

![](/files/MKODjFZH0sa0zJjYT2jl)

## L﻿earn more

* Learn [how Littledata sends the events](/integrations/shopify-to-google-analytics/how-it-works-shopify-to-ga4.md) from Shopify to Google Analytics
* View our Google Analytics 4 [tracking plan](https://docs.google.com/spreadsheets/d/1Qt9P8RQqfcu8SR07sZByViQrBg8808DGDIXpIjR9Wxo/edit#gid=277331750)
* See [how the Shopify to Segment connection works](/integrations/shopify-to-segment/how-it-works.md)
* View our Segment [tracking plan & event schema](https://docs.google.com/spreadsheets/d/1aljowRhMU9_7uGXmcipbP1Y14S4cOSdXGQA2Vx7BHko)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.littledata.io/shopify/tracking-order-refunds-with-littledata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
