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