Measuring Profit using Google’s Universal Analytics

Leveraging Custom Dimensions and Custom Metrics to gain insights into Merchandise and Profitability.

I spend a bit too much time on Twitter. It’s not a terrible thing, as in addition to Twitter being a forum that truly keeps me informed about what is happening in my industry allowing me to stay on the cutting edge for my clients, it is also a social outlet that helps keep me from completely getting swallowed by work. 🙂 That said, sometimes it is hard to wade one’s way through all of the chatter in order to find the good stuff. One of the people out there who is almost always tweeting quality things is Kevin Hillstrom, @minethatdata. It just so happens that yesterday seemed to be a minor “@minethatdata appreciation day” with some other industry peeps giving Kevin a well-deserved thumbs up.

One of the things that Kevin consistently wants others in the digital measurement industry to think about is merchandise and profit. A simple search on his timeline for July 2013 shows that he mentioned profit no less than 43 times and merchandise at least 28 times.

This post is about measuring profit using Google’s Universal Analytics.

**Disclosure: I personally am not a very big fan of the Universal Analytics name. I just think of UA as Google Analytics (which it is). However, for the purposes of this post I am going to refer to the product as Universal Analytics so that readers can note that while the following usage of Google Analytics was possible in the past (acrobatics required), I am highlighting the fact that Universal Analytics takes GA’s capabilities to the next level.

One of the things that I have been enjoying a lot in the past few months doing analytics implementations with Universal Analytics (still in beta) is the ability to be creative with Custom Dimensions. Custom Dimensions are the next incarnation of Custom Variables and allow you to describe your data in new and interesting ways.

Another aspect of Custom Dimensions that should not be overlooked is the fact that they are given “real names” that are set in the Google Analytics backend (admin). With the previous version of Google Analytics one had to keep a small chart handy to allow them to map their custom variable Name / Value combinations. Otherwise reporting could get really confusing, especially across multiple people within an organization. In Universal Analytics, Custom Dimensions are given real names that make sense for you and your business. Excitingly, this makes it a snap to build out powerful reports that allow for the analysis of a wide range of different types of data.
In addition to Custom Dimensions, Universal Analytics also supports Custom Metrics. Currently, Custom Metrics can either be an integer, currency or time (in seconds). The pairing of Custom Dimensions with Custom Metrics brings a new level of flexibility to the Google Analytics product and opens up a wide horizon of implementation opportunities for businesses who need data tailored to their particular objectives (by which I mean, all businesses).

During a recent Universal Analytics Implementation for a B2B retailer, we decided to leverage the fact that UA gives us 20 Custom Dimensions to create a tracking framework that adequately described their merchandise as well as integrated in with their customer database to describe their customers. In this case, my client had a very well-defined merchandising database with a clear taxonomy product category, subcategory, sub sub category etc. This is important to them because they spend a significant amount on Paid Search where the campaign and ad group structure very closely matches their internal merchandising categorization. Additionally, a lot of searches in their industry are done by brand name, so this too is an important custom dimension to define. Here’s the list of Custom Dimensions that we created; I’ve gone ahead and highlighted the “product level” dimensions in yellow.

I decided to rename Product Category, Product Name, and Product SKU as (view) so that those dimensions don’t get confused with the “item hit” dimensions of the same name.

One key aspect of hit level Custom Dimensions (like CVs), is that it they are able to associate product metadata to all hits that happen on a product page (pageviews, events). Last year during an Analytics Hangout with Bryan Eisenberg, I learned an awesome analysis technique called the “Look to Book” ratio which can be implemented using hit level CDs or CVs.

In short, it is a “batting average” for how likely a product is to sell if users view the product page. In the past, I would get this data using a page level custom variable or a noninteractive event in the not so uncommon situation that I’ve run out of custom variables (as mentioned, GA Standard only comes with 5). With Universal Analytics, the bump to 20 Custom Dimensions means a lot more flexibility in an implementation. Again, I want to point out that pretty much everything that I’m discussing in this post was possible with ‘regular” Google Analytics; it was just not nearly as clean or simple to implement.

Back to hit level Custom Dimensions… With Universal Analytics it is much easier to do things such as describe which product categories and brands are receiving the most social shares on product pages (not so important). Or which products, brands, product categories, etc. are being added to the cart (ooh, that is important). (Easier because there are more dimensions and they’re described by “words.”)

Ok, so by now you’re probably saying, “we’ll that’s all fine and dandy, but what about the profit?”

Hehe… not sure why I through in that picture, not really my style. Oh well….

Custom Metrics and the Measurement Protocol.

With Universal Analytics, Google introduced a standardized protocol for sending data to Google Analytics which they aptly named the “Measurement Protocol.” With standard Google Analytics, getting server-side data over to GA and have it match the user’s session was a real pain. Pretty much all aspects of the gif request needed to match / mirror the gif requests being sent from the client side. Additionally, and I don’t think very many people know this, both client-side and server-side hits for ga.js should be changed to use the Mobile processing pipeline by renaming the UA-XXXXX-Y account ID to MO-XXXXXX-Y. That way the utmip parameter can be attached as well and proper geolocation reporting will exist and their obese synchronicity between one’s client-side data and server-side data (i.e. sessions matching).

With Universal Analytics the proper method for sending server-side data is standardized and documented. And, since the sessions for Universal Analytics are calculated on the server, as long as the ClientID is a part of the Measurement Protocol HTTP POST or GET, then the sessions will match up and we can send pretty much whatever data we want.
The reason why using the Measurement Protocol is so key in this case is because I did not want to send Custom Metrics that included profit margin in client-side code. For most clients of mine, profit margins are not things that they want to share with their competitors. So passing data about profitability to Universal Analytics at point of sale within the browser is not the way that we want to go. However, with the Measurement Protocol it was relatively straightforward to send custom dimensions and custom metrics that were bound to event hits at point of sale which allow for, in my humble opinion, a level of reporting that is revolutionary in Google Analytics.

The data that we are sending to Universal Analytics at point of sale is product level, line item data. So, for each product sold we send an event hit with all of the Custom Dimensions we’ve defined for the product (matching data on the product page), together with the Quantity of Items Sold, the products listed price (quantity X price = gross revenue), the individual product’s Cost of Goods Sold, and line item gross profit per product (quantity X (Product Price – COGS)). Since we passing that information at the SKU level, Universal Analytics will automatically calculate the metrics we are looking for across all dimensions in the hit. As such, we can see profit listed as a currency metric in Google Analytics in a way that was not possible before.

For all of you “math people” out there, yes the numbers don’t quite add up because they are being rounded.There are a few reasons why it is important to me to have this sort of data in Google Analytics as opposed to just analyzing the sales database for merchandising / profitability data.

1). When merchandise and profit data is paired with web analytics data we have full visibility into the performance of marketing channels. Now the ROI metric in as expressed in the Adwords reports can be replaced by an easy to calculate “Real ROI” based upon profit for each Campaign, Ad group, etc.

2). Google Analytics is a amazing powerful query engine. The speed at which segments / filters can be applied to this data from the UI is nothing short than marvelous.

3). Google Analytics has great data visualization capabilities. Imagine the ability to pump this these metrics into Motion Charts. #thinkaboutit

Thank you, Kevin, for inspiring me to write a blog post that talks about Profit and Merchandise. 🙂

Yehoshua, thanks for sharing this. It’s a great example of Universal Analytics measuring end to end success. My main concern with pushing metrics like profit into GA is the danger that stakeholders may start using GA as a financial tool (which is not) or worse, may start making comparisons between GA data and their backend financial data.

Of course, this has always been a danger with metrics like revenue but I’m wondering whether profit as a metric may increase the need for us, digital analysts, to manage expectations. What has been your experience so far?

Great read, thanks again

Carmen

Yehoshua Coren

Hi Carmen,

I don’t share your concern. As you know, Google Analytics is simply measuring non-adjusted gross profit in this case. Things like charge backs, returns, cancelled orders, etc are not taken into account. As such, I don’t think that people are going to start filing their taxes based upon GA data or expect a 1 to 1 relationship between backend data with front end collected data.

Managing expectations here, as with your “revenue” example, is the key. I believe that as analysts we have a responsibility to let our clients know what the data is or is not saying.

I absolutely agree with you and fortunately none of the stakeholders I’ve worked with in the past have had that tendency but as Universal Analytics empowers more companies to implement it, often independently in-house, I can envision this causing some confusion.

Thanks for the post, I read your posts and Google+ comments with interest.
Carmen

I absolutely agree with you and fortunately none of the stakeholders I’ve worked with in the past have had that tendency but as Universal Analytics empowers more companies to implement it, often independently in-house, I can envision this causing some confusion.

Thanks for the post, I read your posts and Google+ comments with interest.

Carmen

Charles Meaden

In the screenshot that you’ve got detailing the data being passed back to Google Analytics, am I correct in thinking that event and custom dimension information is being passed across in a single hit?

I’ve been trying to set a custom dimension on page load and then fire an event when an item is added to a basket, but this didn’t carry the dimension across

Yehoshua Coren

If the custom dimension is set on the page, it should then apply to all additional hits that fire on that page. If you want to share a link to the site you’re having trouble with (or email me), I’d be happy to take a look.

FWIW, in the screenshot the Custom Dimensions which are bound to the Event hit are being sent serverside.

Charles Meaden

Thanks for the kind offer. In working through the problem I discovered how to set the dimension on the page which then answered my original question

Clare

hi – sorry if this is an obvious question – can I import the cost data from a stand alone spreadsheet, or does it have to come from our website? Many thanks!

Yehoshua Coren

Hi Clare,

Google Analytics supports importing Custom Dimensions through a standalone spreadsheet. Please note that my post showed how to use Custom Metrics in reporting. A custom dimension would show something such as the number of product views for an item based upon its margin (margin would be in the rows of your reports). A Custom Metric (the columns) cannot be uploaded in this way (yet).

Clare

Thank you – I have private messaged you – as I think I may need your help!

Phillip Barnes

Thank you for this article. I’d like to know if you have figured out how to use Custom Dimensions with the Acquisition > Cost Analysis Report?

I tried to view the report by a Custom Dimension (both as “Hit” and then “Session” data), but the report always shows $0 for cost. Am I doing something wrong?

Yehoshua Coren

@philbar_sjvc:disqus Sadly, cost data is unavailable with segments applied. Same is true of Adwords cost data.

rcaruk

Firstly, thanks for sharing Yehoshua. Very insightful. Secondly, would your implementation be different when using Enhanced Ecommerce? I ask because as you know most of your custom dimensions are already available by default. Would we still need to duplicate that data in order to get the COGS and Profit?

Yehoshua Coren

The implementation is very similar with enhanced ecommerce. You won’t need to do any duplication, you’ll just want to make sure that your custom metrics are scoped to the product instead of being hit level.

The release of enhanced ecommerce is a much much cleaner way of tracking gross profit in GA because it does it on the “product” level and let’s you map to any product level dimension. My original blog post was a way at getting Enhanced Ecommerce functionality out of GA before Enhanced Ecommerce existed.

About the Ninja

Analytics Ninja LLC was founded by Yehoshua Coren out of a desire to bring his passion for analytics and success in Internet marketing to a larger audience. Learn more…