Attribution in Enhanced Ecommerce Reports

Guide to how attribution works in Google Analytics' Enhanced Ecommerce data model.

Enhanced Ecommerce is a very useful set of reports in Google Analytics. They extend the standard Ecommerce funnel, which measures only purchases, and allow you to observe products from the very first impression, through various interactions, all the way to the purchase and even beyond, if the user wanted a refund. Google has some solid documentation on how to implement and interpret Enhanced Ecommerce, but if there’s one area that would deserve more illumination, it’s attribution.

In this case, I’m not talking about attribution in its profit-steering sense. Instead, I’m talking about how Enhanced Ecommerce treats the product in its nexus, and what parts of the Enhanced Ecommerce funnel persist and/or retroactively apply to all the other parts. This might sound cryptic, but I’ll try to make it clear in the subsequent chapters.

UPDATE 25 July 2016: I originally completely overlooked the attribution associated with Internal Promotions. I updated this post to reflect this method of attribution, too. Thanks to Iain Duncumb for pointing this out in the comments!

1. There is minimal attribution

Wait, did I just spoil the entire article? No, I just wanted to catch your attention. Indeed, there is almost no attribution in the Enhanced Ecommerce funnel. If you send product details in, say, the Product Detail View step, you will need to send all the same details in the Add To Cart step, if you want to query any part of the payload across the two steps.

Allow me to illustrate this. Let’s say the visitor views a pair of shoes in your online store. Upon loading the page, you send the following Product Detail View:

window.dataLayer.push({
  'event' : 'ecommerce',
  'ecommerce' : {
    'detail' : {
      'products' : [{
        'id' : 's12345',
        'name' : 'Ahava Shoes',
        'variant' : 'Black'
      }]
    }
  }
});

The user loves the shoes, so they add them to the cart. However, because you believe in attribution (why shouldn’t you?), you decide to cut some corners and only push the following Add To Cart action:

window.dataLayer.push({
  'event' : 'ecommerce',
  'ecommerce' : {
    'add' : {
      'products' : [{
        'id' : 's12345'
      }]
    }
  }
});

Now, when querying this in the Google Analytics reports, you might expect to see an Add To Cart count for the product name “Ahava Shoes”, too, but sadly:

Because the primary dimension is Product (corresponds to name in the ‘products’ object), you see only a Product Detail View for “Ahava Shoes”, because the “Ahava Shoes” product name was not included in the Add To Cart action!

This is crucial. If you want to query any product or any step of the funnel, you will need to add all the dimensions you want to query against in all the steps of the funnel.

In other words, there is no attribution in the Enhanced Ecommerce “Shopping Behavior” funnel. Sadly, that comprises most of the useful parts of Enhanced Ecommerce. However, I understand the design choice, since the data in Google Analytics is essentially one big table, where each row (i.e. hit) is self-contained. Adding attribution similar to how e.g. Session-Scoped Custom Dimensions work might be hazardous.

At the same time, this could be solved by adding more toggles to Enhanced Ecommerce options. Perhaps there could be a switch that would let you “freeze” payload attributes after sending them in a Product Detail View. So if you send a full payload of keys and values in the Product Detail View, it would be enough to just send the SKU in all the subsequent steps. But I’m still not sure how it would work.

2. Product List and Internal Promotion Attribution

However, there is attribution in Enhanced Ecommerce. Two kinds of it, in fact. The first one is Product List Attribution, and Google has recognized it in the support documentation:

I want to show you how it works in practice.

First, one detail that is missing from the documentation above. Product List Attribution only works against a Product SKU (‘id’). It does NOT work with the Product Name (‘name’). This is a very important distinction, as the developer documentation for Enhanced Ecommerce requires that each product payload have either ‘id’ or ‘name’ included, but if you want Product List Attribution to work, the payloads must share the ‘id’ value.

Here’s how Product List Attribution works in a nutshell:

As you can see, the list attribute is only added to the Add To Cart action. Nevertheless, all the subsequent actions against the same Product ID are attributed back to the list. That’s why you see 1 Product Checkout and 1 Unique Purchase for the Search Results list, even though that list attribute was not pushed in the checkout or purchase actions.

Actions, here, means the following Enhanced Ecommerce hit types:

In other words, if you send the list attribute with any of these payloads, it will persist through all the subsequent Enhanced Ecommerce actions in the same session. However, if you send another list attribute in a subsequent action, the current attribution chain will break, and the new list will receive all the glory for the later actions.

Here’s an illustration with actual data:

In the report above, each row describes a different action which was the last one to receive the list attribute. So the addWithList Product List, for example, is a list which was sent with all the Ecommerce payloads up to the Add To Cart action (i.e. ‘impressions’, ‘click’, and ‘detail’), and with no list for the remaining payloads (i.e. ‘checkout’ and ‘purchase’).

As you can see, clickWithList, detailWithList, addWithList and checkoutWithList all attribute the full Enhanced Ecommerce journey to the list. With impressionWithList there is no attribution, because Product Impressions is not an Enhanced Ecommerce action.

The last two rows show how the attribution breaks with a new list. The list firstAddThenClickWithList_add is a list sent with a specific Product SKU in the Add To Cart payload. Then, the same product SKU is suddenly the target of a Product Click on some other list named firstAddThenClickWithList_click. This breaks the attribution for the first list, which is why you see no data for actions after the Add To Cart. Instead, the user finishes the journey all the way up to the purchase, and all the credit for the actions is attributed to the last list that was interacted with.

This isn’t a very typical scenario, though, but it might occur if you’re promoting products which the user has already added to the cart. So if they see a product listing for a product already in the cart, and they click this listing, it will break the attribution chain which initially added the product to the cart.

I hope that made sense. The logic is very clear: for each Product SKU, the last Product List included in an Enhanced Ecommerce Action gets all the credit for subsequent Enhanced Ecommerce actions.

Internal promotions

Attribution for internal promotions is a bit different and, if I might add, kinda awkward.

If there’s an Internal Promotion Click in the session with the transaction, then the last click sent before or with the transaction hit gets the full attribution of the purchase. In other words, if you send a promotion click in the transaction itself, then that promotion click gets the full transaction attribution. If there’s no promotion click in the transaction, then the last click sent in the session before the transaction gets the credit. Never will a promotion click after a transaction get credit for the purchase.

If there are no promotion clicks in the session before or during the transaction, but there are Internal Promotion Views in the transaction hit itself, then all those views in the transaction hit get full credit for the transaction. Never will a promotion view anywhere else except in the transaction hit itself get credit for the purchase.

Thanks to Iain Duncumb and Christian Mochow for pointing out inconsistencies in this chapter.

There are more details about this here.

Summary

That’s about the gist of it. The key things to remember are:

  1. Outside Product Lists and Internal Promotions, there is not attribution of values across Enhanced Ecommerce payloads.

  2. In Product Lists, attribution revolves around Product SKUs and Enhanced Ecommerce Actions.

  3. For each Product SKU, the last Product List the user interacted with in an Enhanced Ecommerce Action is the one to which all subsequent actions within the same session are attributed.

  4. In Internal Promotions, full credit for the transaction is attributed to the most recent Promotion Click in or before the transaction hit, or lacking that, any Promotion Views sent with the transaction hit itself.

In my own experience, especially product lists have received only a little attention in Enhanced Ecommerce, partly because not all online stores have what you would consider a consistent “list” setup. However, because of this powerful attribution feature, it might make sense to take a closer look at your online store to see if you could use it for something else, instead. Most of Google Analytics’ power comes from taking a feature intended for A, and using it for B or maybe even C instead.

The same observation could be said for Internal Promotions, whose application might be difficult to figure out in a typical webstore. Nevertheless, the very fact that it has something resembling “post-view conversions” should already invite you to figure out ways of implementing Internal Promotions to your advantage.