Fixing Duplicate, Cancelled, Test Orders & Refunds in Google Analytics

Maintaining the accuracy and consistency of your data esp. e-commerce data is a critical aspect of your analysis.

So how confident you are on the scale of 1 to 10 then that ecommerce data in your GA reports is accurate?

Imagine a scenario where large part of the website sales is made up of sales data from test orders or a scenario where you declared top 10 regions for directing your marketing efforts and budget on the basis of corrupted ecommerce data.

Now imagine where this flawed analysis will take you over time in terms of time spent, budget and resources allocation.

Skewed ecommerce data is more common than you may think.

I once discovered test orders worth $40k in one of the GA view.

This $40k figure mislead me in many ways for a while and made me think that something is working or is important when it wasn’t.

I want you to avoid being mislead by corrupted ecommerce data.

The number 1 way of avoiding being mislead is by making your shopping cart software your best friend.

If you do not have access to shopping cart of your client then get one.

Even ‘view only’ access will work just fine.

But get that access and periodically match the sales data between your Google Analytics account and Shopping Cart account.

Data Discrepancy between Google Analytics and Shopping Cart Sales Data

Google Analytics and shopping cart sales data generally do not match.

There can be lot of reasons for that.

But one of the main reason is, that Shopping carts (like shopify) handles sales data (cancelled orders, unfulfilled orders, test orders, promotions and refund) much better than Google Analytics.

To learn more about the discrepancies between Google Analytics and Shopping cart sales data, read this article: Why Google Analytics and Shopping Cart Sales data don’t match and how to fix it.

Get the E-book (52 Pages)

Get the E-Book (37 Pages)

Fixing Duplicate Orders in Google Analytics

Duplicate orders/transactions can take place when the order confirmation page (receipt page) can be loaded more than once by the same user without placing any new order.

With each new page load, the ecommerce data is resent to GA server.
Within a session, Google Analytics will filter out duplicate transactions. But if a user comes back later in a different session and revisit the order confirmation page then the transaction data could be sent again to the GA server thus creating duplicate order.

These duplicate transactions will then show up in your report and inflate your sales data. So you need to ask your developer to:

#1 Make sure a user can not access the order confirmation page more than once without placing a new order.

#2 Make sure a user can not refresh the order confirmation page. If this is not possible then make sure the ecommerce tracking code is not executed on a reload/refresh.

#3 If you maintain the exact same code on your staging website, there is a possibility that test orders are inflating your sales data. In order to make sure that this doesn’t happen, the ecommerce tracking code should not fire on the staging website.

So if someone visit the order confirmation page on the staging website or place a test order, no ecommerce data should go to the Google Analytics server. This can only be done by stopping the ecommerce tracking code from being executed in the first place.

Here is how you can find duplicate transactions in Google Analytics:

Step-1: Download this custom report in your GA view and then select your reporting view:

Step-2: Set time period of the custom report to the last one month and then look at the transactions column.

They should all be 1.

If you find any value greater than 1, then you have got duplicate transactions issue:

Step-3: Check this report at least once a week, to make sure that no duplicate orders have been placed on the website.

Fixing Cancelled and Test Orders in Google Analytics

You can fix cancelled and test orders in Google Analytics by reversing ecommerce transactions.

To learn more about such reversal, read the followings articles:

#1 How to reverse an ecommerce transaction in Google Analytics.

#2 How to remove / modify Google Analytics ecommerce transaction in one click

#3 How to identify negative transactions in Google Analytics

Dealing with Refunds in Google Analytics

If your business, issue lot of refunds, then you need to adjust your sales data accordingly, in Google Analytics, to reflect the refunded sales amount in your ecommerce reports.

There are couple of methods to do that.

One is by making changes to your ecommerce tracking code as explained in great detail, in the article: How to reverse an ecommerce transaction in Google Analytics 

The other method is to use the ‘Refund Data Import‘ feature which is explained in great detail in the article: Dealing with refunds in Google Analytics

Other Articles on Enhanced Ecommerce Tracking

#1 Understanding Enhanced Ecommerce tracking in Universal Analytics

#2 Implementing Enhanced Ecommerce tracking in Universal Analytics – Nerd Guide

#3 Using Cohort Analysis & Enhanced ecommerce to understand users behavior

#4 Using Enhanced E-Commerce segments for Remarketing in Google Analytics

#5 Enhanced Ecommerce Tracking via Google Tag Manager

Most Popular E-Books from OptimizeSmart

Learn to read e-commerce reports book banner

How to learn and master Web Analytics and Google Analytics?

Take the Course

Check out my best selling books on Web Analytics and Conversion Optimization on Amazon

How to get lot more useful information?

I share lot more useful information on Web Analytics and Google Analytics on LinkedIn then I can via any other medium. So there is really an incentive for you, to follow me there.

Himanshu Sharma

Certified web analyst and founder of

My name is Himanshu Sharma and I help businesses find and fix their Google Analytics and conversion issues. If you have any questions or comments please contact me.

  • Over twelve years' experience in SEO, PPC and web analytics
  • Google Analytics certified
  • Google AdWords certified
  • Nominated for Digital Analytics Association Award for Excellence
  • Bachelors degree in Internet Science
  • Founder of and

I am also the author of four books:

error: Alert: Content is protected !!