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

All of the following orders/transactions (along with their associated sales data) are recorded and reported by Google Analytics:

  • A cancelled order
  • An order which is declined or unfulfilled
  • A test order placed on your website by your web developer.

Now in order to maintain accuracy in your ecommerce reports, you would want to remove all the test/cancelled/unfilled orders from Google Analytics.

You can do that by reversing ecommerce transactions.

I have explained, reversing an ecommerce transaction before, by:

  • creating a duplicate of the order confirmation page
  • making changes to the ecommerce tracking code and
  • then firing the ecommerce code.

But all of this require the help of a web developer and is time consuming.

Today I am going to show you, how to remove/modify any ecommerce transaction in your Google Analytics report, in just one click and that too, all by yourself, without taking the help of a web developer.

For this purpose, we are going to use Google Analytics measurement protocol hit builder.

But don’t let the measurement protocol scares you. It is easier than you think.

Get the FREE E-Book (31 Pages)

Follow the steps below:

Step-1: Make sure you have the ‘Edit’ permission at the GA account/property level.

Step-2: Take a note of the transaction ID you want to remove. You can find transaction ID by navigating to Conversions > Ecommerce > ‘Sales Performance‘ in your GA view:

Say for example,

If you want to remove a test transaction, then navigate to the ‘Sales Performance’ report in your GA view and find the ID of the test transaction. Once you know the transaction ID, make a note of it.

You will need this ID later, when using the measurement protocol hit builder.

Step-3: Navigate to: https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#ecom

Step-4: Click on the link ‘View this hit in the Measurement Protocol Hit Builder‘ under the section ‘Transaction Hit’:

This action will automatically populate the ‘Hit Payload’ field with sample transaction hit data:

Step-5: Scroll down to the section ‘Hit Parameter Details‘ and then change the value of all parameters except ‘v’ and ‘t’:

Here,

v => Version. The value of this parameter is always 1.

t => transaction hit type. Example of other hit types: pageview, screenview, event, item etc.

tid => your property ID. Example: UA-12345-12

cid => Anonymous Client ID. Example: 555 or any alphanumeric number.

ti => your transaction ID. Example: 12345

ta => Transaction affiliation. Example: WesternWear

tr => Transaction revenue. Example: 50.00

ts => Transaction shipping. Example: 32.00

tt => Transaction tax. Example: 12.00

cu => your Currency code. Example: EUR, USD etc

For example,

Let us suppose you want to remove the following transaction:

Here,

The transaction ID is ‘592999‘. So ti592999

The Transaction affiliation is ‘Pre-Payment‘. So taPre-Payment

The sales amount associated with the transaction is: $9,752.40. So tr = 9752.40

The shipping amount associated with the transaction is:$20.51 . So ts = 20.51

The tax amount associated with the transaction is: $1,557.11. So tt = 1,557.11

The currency associated with the transaction is: US dollars. So cu = USD

Let us suppose Your tracking id is: UA-12345-21

Get the E-book (52 Pages)

Get the E-Book (37 Pages)

 

Now in order to remove this test order from your ecommerce report, create following transaction hit with the hit builder (with negative amount for sales, shipping and taxes):

v= 1

t= transaction

tid = UA-12345-21

cid = 6ec419f1-32e0-4546-bb9e-4cb97c586512

ti = 592999

ta = Pre-Payment

tr = -9752.40

ts = -20.51

tt = -1557.11

cu = USD

Here is how this transaction hit will look like in the hit builder:

Note: You can use any string as client id (cid).

Step-6: Click on the ‘validate hit‘ button to validate your hit:

validate hit

Once you clicked on the ‘validate hit’ button, you must see the ‘hit is valid’ message:

hit is valid

Step-7: Click on the ‘Send hit to Google Analytics’ button, to send the transaction hit to GA.

Step-9: Wait for at least 10 to 15 minutes, before you proceed to check your ‘Sales Performance’ report in GA and search for your test transaction.

If the test transaction was placed on the very same day you removed it then you would no longer see any entry for your test transaction in the ‘sales performance’ report.

If however the test transaction was placed several days/weeks/months ago then you will see a new entry in your ‘sales performance’ report which contains the reversed transaction:

So for example, Let’s say a test transaction was placed on June 30 and you removed it on Oct 26.

Now if you see the GA report for June 30, you will still see the entry for the test transaction.

Similarly, if you see the GA report for Oct 26, you will see the new entry for the reversed transaction.

So it may look like nothing changed and you end up getting one more entry for the same transaction.

But if you see the GA report from June 30 to Oct 26, you will notice the total amount associated with the test transaction is $0.

So what you basically removed when a test transaction is days/weeks/months old is the total amount associated with the transaction.

Use the same method to remove any transaction from GA.

Now let us suppose, the transaction that you want to remove, does not have any shipping and tax amounts associated with it. In that case, do not pass shipping and tax amounts in your transaction hit.

v=1 // Version.
&tid=UA-12345-21 // tracking id
&cid=4552423 // Anonymous Client ID.

&t=transaction // Transaction hit type.
&ti=TEST24425 // Tansaction ID
&tr=-500  // negative Transaction revenue
&cu=GBP // Currency code

If you want to modify the details associated with a transaction, say you want to add sales and tax amounts to a transaction, then just supply them via the transaction hit:

v=1 // Version.
&tid=UA-12345-21 // tracking id
&cid=4552423 // Anonymous Client ID.

&t=transaction // Transaction hit type.
&ti=23455655 // Tansaction ID
&ts=10.22 // Add Transaction shipping
&tt=1.21 // Add Transaction tax
&cu=GBP // Currency code

Here I have added shipping amount (£10.22) and tax amount (£1.21) to the transaction, whose ID is ‘23455655’

However use the measurement protocol hit builder tool with extreme caution, as you can very easily skew your ecommerce data, if you are not sure what you are playing with.

 

Learn to read e-commerce reports book banner

Get the E-Book (104 Pages)

 

Related Articles

Take the Course

Most Popular E-Books from OptimizeSmart

Learn to read e-commerce reports book banner

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 OptimizeSmart.com

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 OptimizeSmart.com and EventEducation.com

I am also the author of four books:

error: Alert: Content is protected !!