Using the Google Analytics Tax field for Transaction Type
05/08/2012 | Written by | Categories: Analytics Set-up

Figure carrying Tax word

I haven’t written a blog post for a while, some might call that lax but I will claim to having been too busy.  You might not have missed me or these posts in your inbox but I missed writing and sharing information.  In good news I have been busy with clients + setting up a second company to be launched soon + helping to organise the first UK Digital Analytics Unconference (MeasureCamp).  More details on MeasureCamp and my new company to be released soon.

An online retail client of mine needed to record the type of transactions being placed on their website (they use Google Analytics).  They sell prescription glasses and sunglasses online but customers can also choose to Try at Home first, take advantage of a Two for One offer to get new lenses for their existing glasses.  Recording the type of transaction (using a hierarchy for multiple types within the one purchase) is necessary for understanding the sales performance for each day.

My typical solution for a transaction category is to use the Affiliation field, but that was already taken to record the level of discount from promotional codes.  An alternative is a page level custom variable on the order confirmation page but that didn’t feel ideal.  So were there any other options?

I realised the only unused transaction field was Tax (apart from the geographical fields which are currently fairly pointless).  My client wasn’t using it to record the tax from transactions and there would be no requirement to do so in the future – an accurate tax bill could only come from back end systems.  As Tax is a numerical field, I have never thought of using it to record the name of a transaction type – but could I use a code instead?

An issue is that values in the Tax field are summed up over multiple transactions.  But as I intend to use the field to filter transactions, this will not cause any problems.  So the approach will work if a code is used to represent each type of transaction e.g. 1 = Two for One, 2 = Try at Home.  In fact, the first digit can represent the type of transaction and the second digit can represent the number of glasses purchased during within the transaction (unlikely to be more than 9 for any single purchase).

As mentioned, a hierarchy needs to be applied as only one transaction type can be recorded for each transaction.  So if two glasses are purchased through a Two for One deal and a reglaze is purchased within the same transaction, then the transaction is recorded as a Two for One as it is higher in the hierarchy.

For examples:

  • Tax = 14, four glasses purchased as part of a Designer Two for One offer
  • Tax = 41, one pair of non designer glasses purchased
  • Tax = 70, Try at Home box ordered with no glasses purchased

So to count the number of Designer Two for One transactions, simply filter transactions for Tax > 10 and < 20.  Or for Reglaze transactions, filter transactions for Tax > 50 and less than 60.

This is not ideal, it would be great if Google gave us some more descriptive variables for transactions (and other areas).  But an important aspect of Google Analytics is making use of the variables available to you to get at the intelligence you need.  And I think this approach is a valuable way of extracting useful intelligence – what do you think?

2 responses to “Using the Google Analytics Tax field for Transaction Type”

  1. Very interesting use of the tax field, Peter. I too have found there there can be valuable uses of unused fields in GA. Out of curiosity, why did you feel that a Custom Variable wasn’t a good fit for this situation? Similarly, why not use event tracking which is even more extensible? Personally, event tracking would be my first choice for this type of situation.

    • Peter O'Neill says:

      Hi Yehoshua – there was no definite reason for chosing the tax field over anything else. I wanted to use an identifier than was part of the transaction measurement as I thought that would be the most accurate method. Using a page level custom variable or an event requires an addition line of code plus would be triggered by all page views of the confirmation page – and views are inflated compared to transactions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Looking to improve your digital analytics or conversion rate optimisation?
Contact us today on   +44 (0)20 3865 1589

Alternatively, come visit us in London and we’ll buy the coffee!
Get in touch
Leave us a message
Use the form below to leave us a message.

1 Primrose Street
London EC2A 2EX