How to Refund and Cancel Orders in Google Analytics

Learn how to import refund and order reversal data in Google Analytics for more accurate revenue by channel metrics.

Refund or cancellation data within Google Analytics is not something I’ve seen much…probably less than 5% of businesses I’ve worked with in my career either had this process in place or worked to get there.

Granted, cancellations and/or refunds are only a fraction of ensuring business-wide data accuracy, however it was clear that decisions were made on accurate data.

The process for managing refunds in GA is largely the same for any eCommerce platform – Shopify, Magento, BigCommerce, Commerce Cloud, etc.

A few callouts:

There is a difference between reversing a transaction and refunding a transaction. Reversing a transaction is done by sending a negative value while refunding a transaction will populate the native refund metrics available in Google Analytics.

In order to import refund data via the Data Import feature in GA you need to be utilizing Enhanced eCommerce.

You can’t “fix” refunds that have been already imported…so be sure you test refund imports on a test view first to verify it works as expected.

To be safe, check reports the following day after importing data to minimize freaking out if the data looks weird a few hours after.

Then name your import in Step 2 Data Set Details and leave your Data Set Schema in Step 3 as is (you should only see Transaction ID column) and click Done.

Your next step is to upload your CSV file in the Manage Uploads Settings of this new data import:

Once you upload your file, you should see a status screen which shows the success of your import:

That’s it!

If you are importing partial items as part of an order (e.g. only 1 qty of an order that has > 1 qty or partial amount on a single qty) then you’ll need to configure an import with a few more columns (shown below).

In your data schema details from step 3, be sure to select these fields shown in row 1 below that you’re including in your import:

Note: If you’re importing a file with partial refunds then you need to have every field completed. You can’t have one row with only transaction ID for a full refund and another row that is completed for a partial refund.

Another option is to automate the process of uploading your Data Import CSV file (from the first option above) through the Management API. Here is where you can get started on this and there are a few good examples of hooking this up via Google Sheets as well (here’s one example).

How to Reverse a Transaction in Google Analytics

This is close to a refund import hit except we’re sending another transaction hit with negative values to zero out the data from the original order.

The difference from refunds is we just aren’t populating the native refund metrics in Google Analytics…I think that’s about it?!

Here is how this looks in the hit builder:

A few things to note in red:

Total transaction revenue, tax, and shipping are negative values.

Product quantity is a negative value.

Individual product price is a positive value.

That’s pretty much it. Validate and send your hit then wait a bit to see this show up as an additional hit for this transaction ID.

How to Analyze Reversed or Refunded Reports

If you’ve never refunded orders in Google Analytics then you might get a bit confused when reviewing your transaction reports the first time.

Remember – GA is not going to delete the original order data so depending on the date range you are viewing you might see orders you expected to be refunded like this:

Notice the revenue and refund amount columns?

Once you include the date when you imported your refund data, you should see something like this:

Wait…why do some of my orders have $0 revenue and others don’t?

Well in this case these orders were placed in October but my report is November – December. Once I change my date, I now see revenue here too (phew):

Now we can begin creating reports to slice our refund data further; like by medium:

Google states one caveat of viewing refund data by source/medium – if the user returns to your site after placing an order and still has their original GA cookie in place then this refund will be attributed to the last session they visited from…not the session where they completed the purchase.

Not very helpful.

I hope this quick tutorial on importing refunds to Google Analytics helps :).

Brad Redding

Brad, co-founder of Elevar, has lived in eCommerce for over 12 years. He's helped design, build, and optimize over 100 websites in his career. From new retail startups to well-known brands like Le Creuset, Signature Hardware, Rebecca Minkoff, Char-Broil and more, he specializes in data analytics and conversion optimization to help achieve business goals.

Just wanted to call out this is a great post. Most detailed and valuable post I’ve found so far on GA refunds.
Have you come across new features in GA/GA360/DataStudio that improve refund attribution? I’m looking for a couple features :
– attribute a refund to the original order date
– attribute a refund to the original source/medium