Friday, September 25, 2015

Enhanced Ecommerce tracking in Universal Analytics

Enhanced ecommerce tracking is a complete revamp of the traditional ecommerce tracking.
Since enhanced ecommerce is such a ginormous concept, I decided to write a whole series on enhanced ecommerce tracking instead of writing just one e-book.
If I try to explain you everything about enhanced ecommerce tracking in a single blog post, I will have to write at least 60-70 pages long blog post which is better called an e-book.
My enhanced ecommerce series include:
  1. Understanding Enhanced Ecommerce tracking in Universal Analytics
  2. Implementing Enhanced Ecommerce tracking in Universal Analytics (for those who don’t use GTM)
  3. Importing product ID meta data and refund data (to truly use the power of enhanced ecommerce)
  4. Implementing Enhanced Ecommerce tracking via Google Tag Manager (my favourite)
Each successive article in the series is built upon the knowledge acquired through previous article.  So if you miss any article, you may have a hard time understanding the subsequent article(s).
This article is the first in the series in which I will explain the fundamentals and the core of enhanced ecommerce.

Introduction to Enhanced Ecommerce

Enhanced ecommerce is a complete revamp of the traditional ecommerce tracking in the sense that it provides many more ways to collect and analyse ecommerce data.
enhanced ecommerce menu
It is like an ecommerce tracking on steroids.
Following are the key benefits of enhanced ecommerce over traditional ecommerce:
1 Enhanced ecommerce provides deep insight into ecommerce engagement of your users.
Ecommerce engagement is the user engagement in terms of:
  1. Viewing your internal promotion campaign.
  2. Clicking on internal promotion campaign.
  3. Viewing your products in a product list.
  4. Clicking one of the product links in the product list.
  5. Viewing product detail page.
  6. Adding/removing products from your shopping cart.
  7. Starting, completing and/or abandoning the checkout process.
  8. Asking for a refund. 
You can get insight on ecommerce engagement through ‘Shopping Behavior Analysis’ report (under Conversions > Ecommerce > Shopping Analysis in your UA view) and Checkout behaviour analysis report:
 shopping behavior analysis report
Checkout behavior analysis report

2 Through enhanced ecommerce Product Performance report (under Conversions > Ecommerce) you can track:
  1. Total refund amount for each product
  2. Cart to detail rate (the rate at which users add product to the shopping cart after viewing the product details)
  3. Buy to detail rate (the rate at which users buy products after viewing the product details)
  4. Product list views – number of times a product appeared in a product list.
  5. Product detail views – number of times users viewed the product detail page.
  6. Product Adds to cart – number of times a product was added to shopping cart.
  7. Product Removes from cart – number of times a product was removed from the shopping cart.
  8. Product Checkouts – Number of times a product was included in the checkout process.
Product Performance Report

3 Enhanced ecommerce let you create product lists which are logical grouping of products on your website.
This product list is generally a product category page or internal search result page but it can also be list of related products or the product list which is used for up-selling.
Through Product List Performance report you can determine the product lists which appeared to your visitors and you can also measure the effectiveness of your product lists in driving product views (product list views), product clicks (product list clicks) and product CTR (product list CTR).
Product List Performance

4 Through enhanced ecommerce marketing reports you can measure the internal and external marketing of your products. Internal marketing is done via internal promotions and external marketing is done via order level coupons, product level coupons and affiliate websites.
enhanced ecommerce marketing reports
Internal promotions are the promotion of your products on your own website. Like you put a banner ad on your homepage to promote a particular product listed on another part of your website.
Through Internal Promotion report you can determine the internal campaigns which are most and least effective in driving traffic to targeted products. You can measure the views, clicks and CTR for these internal campaigns.
Through Order Coupon report you can determine the order coupons which are most and least effective in driving sales, orders and average order value. So if a coupon is negatively impacting the sales, you can choose to discontinue it.
Through Product Coupon report you can determine the product coupons which are most and least effective in driving sales and orders. So if a coupon is negatively impacting the sales, you can discontinue its use.
Through Affiliate Code report you can determine the affiliate websites which are most and least effective in driving sales, orders and average order value.
In order to understand how enhanced ecommerce tracking works, you first need to understand the ‘Enhanced Ecommerce Measurement Model
Note: Google Analytics does not have any such model in its arsenal. I have created this model just for you, in order to facilitate and speed up the learning of enhanced ecommerce tracking.

Enhanced Ecommerce Measurement Model

enhanced ecommerce measurement model1
enhanced ecommerce measurement model2
enhanced ecommerce measurement model3
Here,
#1 Measure Internal Promotions => measure impressions and clicks on internal promotion campaigns
#2 Measure Product List Views => measure number of times a product appeared in the product list.
#3 Measure Product List Clicks => measure number of times a product link was clicked in the product list.

#4 Measure Product Detail View => measure number of times a product detail page was viewed.
#5 Measure Product Add to Cart => measure number of times a product was added to the shopping cart.
#6 Measure Remove from Cart => measure number of times a product was removed from the shopping cart.

#7 Measure Checkout Steps => measure the various steps of the checkout process.
#8 Measure Purchase => measure product purchase
#9 Measure Refund => measure money refund
This model depicts the typical users’ interactions with a product on your website:
  1. A user may view an internal promotion campaign and then click on it to see a product list page.
  2. The user view a product in a product list (product category page or internal search result page).
  3. The user clicks on one of the product link in the product list to view more details about the product.
  4. The user then view the product details page.
  5. The user then decides to buy the product. So he adds the product to shopping cart.
  6. The user may remove certain product from the shopping cart before checking out.
  7. The user then decides to start the checkout process and complete the various steps in the process.
  8. The user finally completes the checkout process by making a purchase.
  9. The user may ask for the refund of his order.
In enhanced ecommerce we track all of these 9 users’ interactions with your products to get a deep insight into shopping behaviour.
The measurement model shows how the 9 user interactions are actually measured in enhanced ecommerce tracking.

Promo Field Object

This JavaScript object is denoted by ‘promoFieldObject’
This object is used to store impression and click data of internal promotion campaigns (like internal banner campaign) and it looks like the one below:
{
// promoFieldObject stores internal promotion data
  ‘id’: ‘VBSPRINGSALES14’,             // Promotion ID. Required – Type: string
  ‘name’: ‘Spring Sales’,          // Promotion name – Type: string
  ‘creative’: ‘summer_banner2’,   // Creative ad used for the promotion – Type: string
  ‘position’: ‘banner_slot1’      // Position of the creative ad  – Type: string
};
Following are the properties of promoFieldObject:
  1. id
  2. name
  3. creative
  4. position

Impression Field Object

It is denoted by ‘impressionFieldObject’ and is a JavaScript object.
To learn about JavaScript object, checkout this post:  Google Tag Manager Data Layer explained like never before
This object is used to store product list view data and it looks like the one below:
{
 // ImpressionFieldObject stores product impression data
  ‘id’: ‘VBS-2341’,                   // Product ID/SKU – Type: string
  ‘name’: ‘VB Fire T-Shirt’,          // Product name – Type: string
  ‘category’: ‘Apparel/T-Shirts’,     // Product category. Use / as a delimiter to specify up to 5-
                                                         // levels of hierarchy (e.g Men/Shirts/T-Shirts) – Type: string
  ‘brand’: ‘Virgin Blak’,             // Product brand – Type: string
  ‘variant’: ‘Black’,                 // Variant of the product like color, size etc – Type: string
 ‘price’: 45.31,                       // Product price – Type: numeric
  ‘list’: ‘Shirts Category’,          // Product list – Type: string
  ‘position’: 1                      // Product position in a list – Type: numeric
}
Note: An impressionFieldObject must have a name or id value. All other values are optional
Following are the properties of impressionFieldObject:
  1. id
  2. name
  3. category
  4. brand
  5. variant
  6. price
  7. list
  8. position

Product Field Object

It is denoted by ‘productFieldObject’ and is a JavaScript object.
This object is used to store:
  1. Product click data i.e. data of the product whose link was clicked in the product list.
  2. Product details view data i.e. data of the product whose detail page was viewed.
  3. Product Add to Cart data i.e. data of the products added to the shopping cart.
  4. Product remove from Cart data i.e. data of the products removed from the shopping cart.
  5. Checkout Steps data i.e. data of the products at each step of the checkout process.
  6. Purchase data
  7. Refund data
Here is how a product field object may look like:
{
 // productFieldObject stores product click and other details
  ‘id’: ‘VBS-2341’,                   // Product ID/SKU – Type: string
  ‘name’: ‘VB Fire T-Shirt’,          // Product name – Type: string
  ‘category’: ‘Apparel/T-Shirts’,     // Product category – Type: string
  ‘brand’: ‘Virgin Blak’,             // Product brand – Type: string
  ‘variant’: ‘Black’,                 // Variant of the product like color, size etc – Type: string
 ‘price’: 45.31,                       // Product price – Type: numeric
 ‘quantity’: 1,                       // Product quantity – Type: numeric
  ‘coupon’: ‘SHQR45F2002’,          // Product coupon code – Type: string
  ‘position’: 1                      // Product position in a list – Type: numeric
}
Following are the properties of productFieldObject:
  1. id
  2. name
  3. category
  4. brand
  5. variant
  6. price
  7. quantity
  8. coupon
  9. position

Action Field Object

This JavaScript object is denoted by ‘actionFieldObject’
This object is used to store action data. The action data is the data related to ecommerce action like: checkout, checkout option, purchase, refund etc.
The action field object looks like the one below:
{
// actionFieldObject stores action data
  ‘id’: ‘VBT145346’,                      // Transaction id – Type: string
  ‘affiliation’: ‘VB Store’,              // Store name – Type: string
  ‘revenue’: ‘37.39’,                     // Total Revenue – Type: numeric
  ‘tax’: ‘2.85’,                          // Tax – Type: numeric
  ‘shipping’: ‘5.34’,                     // Shipping – Type: numeric
  ‘coupon’: ‘SUMMER2013’                  // Order/Transaction coupon – Type: string
  ‘list’: ‘Shirts Category’,              // Product list – Type: string
  ‘step’: 1,                              // Number representing a step in the checkout process – Type: numeric
  ‘option’: ‘paypal’,   // Used to provide additional info about a checkout step like payment method used- Type: string
};
Following are the properties of actionFieldObject:
  1. id
  2. affiliation
  3. revenue
  4. tax
  5. shipping
  6. coupon
  7. list
  8. step
  9. option

Enhanced Ecommerce Commands

In order to understand how the enhanced ecommerce measurement model works, you also need to understand the various enhanced ecommerce commands.
Following is list of various commands which are frequently used while setting up enhanced ecommerce tracking:

Enhanced Ecommerce Command
Description
1
ga(‘ec:addImpression’,{…});
This command is used to measure product list view data and send it to impressionFieldObject.
2
ga(‘ec:addProduct’,{…});
This command is used to measure product list clicks, product detail views, Product Add to Cart, Product Remove from Cart, Checkout Steps, Purchase and Refund data and then send the data to productFieldObject
3
ga(‘ec:addPromo’,{…});
This command is used to measure impression and click data of an internal promotion campaign and send the data to promoFieldObject.
4
ga(‘ec:setAction’, <action-type>,{…});
This command is used to measure action data and send it to actionFieldObject. This command is often used along with ‘action type’ command which specify which type of action to be measured.
5
ga(‘ec:setAction’, ‘click’, {…});
This command is used to measure product list click.
6
ga(‘ec:setAction’, ‘detail’);
This command is used to measure product detail view.
7
ga(‘ec:setAction’, ‘add’);
This command is used to measure Product Add to Cart.
8
ga(‘ec:setAction’, ‘remove’);
This command is used to measure Product remove from Cart
9
ga(‘ec:setAction’,’checkout’, {‘step’: 1});
This command is used to measure the various checkout steps.
10
ga(‘ec:setAction’,’checkout’, {‘option’: ‘visa’});
This command is used to measure additional information about a checkout step (like shipping method selected) after the initial pageview.
11
ga(‘ec:setAction’, ‘purchase’,{…});
This command is used to measure a purchase.
12
ga(‘ec:setAction’, ‘refund’, {…});
This command is used to measure the refund of one or more products.
13
ga(‘ec:setAction’, ‘promo_click’);
This command is used to measure clicks on an internal promotion campaign.
The measurement model which shows how the 9 user interactions are actually measured in enhanced ecommerce tracking, uses both the JavaScript objects and the ecommerce commands.

Universal Analytics Tracking code for measuring impressions of Internal Promotion campaign

To measure impressions of an internal promotion campaign, use the ec:addPromo command and provide the promotion details in promoFieldObject:

Universal Analytics Tracking code for measuring clicks on Internal Promotion campaign

To measure clicks on an internal promotion campaign, use the ec:addPromo command, ec:setAction command and set the action type to ‘promo_click’:
Note(1): the clicks on an internal promotion campaign should be sent in a seperate hit after the internal promotion impressions data.
Note(2): avoid sending internal promotion campaign data along with product data in a single hit. If you need to send product data then send it in a seperate hit.

Universal Analytics Tracking code for Measuring Product List Views

To measure product list views, use the ec:addImpression command and provide the product details in an impressionFieldObject:

Universal Analytics Tracking code for Measuring Product List Clicks

To measure product list clicks, use ec:addProduct and the ec:setAction commands and set the action type to ‘click’:

Universal Analytics Tracking code for Measuring Product Details View

To measure product details view, use ec:addProduct and the ec:setAction commands and set the action type to ‘detail’:

Universal Analytics Tracking code for Measuring Product Add to Cart

To measure the addition of a product from a shopping cart, use ec:addProduct and the ec:setAction commands and set the action type to ‘add’:

Universal Analytics Tracking code for Measuring Product Remove from Cart

To measure the removal of a product from a shopping cart, use ec:addProduct and the ec:setAction commands and set the action type to ‘remove’:

Universal Analytics Tracking code for Measuring Checkout Steps

To measure individual checkout steps, use ec:addProduct for each product and the ec:setAction command. Set the action type to ‘checkout’ and ‘step field’ to the step number.
For example:
To measure the first step of the checkout, use ec:addProduct for each product in the shopping cart, and ec:setAction to indicate a checkout. Set the step field to 1
Similarly,
To measure the second step of the checkout, use ec:addProduct for each product in the shopping cart, and ec:setAction to indicate a checkout. Set the step field to 2
Following code measures the first checkout step:

Similarly, following code measures the second checkout step:
Note: If your checkout process contains only a single step or if you have not configured enhanced ecommerce checkout funnel settings in your web property then measuring the individual checkout steps is not required.

Universal Analytics Tracking code for Measuring Purchase

To measure purchase, use ec:addProduct for each product and the ec:setAction command. Set the action type to ‘purchase’:
All of this may not make much sense to you now but once we proceed to the second stage of implementing the enhanced ecommerce tracking in the next article, this foundation course will make lot of sense and will come handy.

Universal Analytics Tracking code for Measuring Refund

You can either measure full refund or partial refund.
Full refund means refunding the entire order. Whereas partial refund means refunding a part of the order like refunding a single product.
In order to measure full refund use the ec:setAction command, set the action type to ‘refund’ and provide the transaction ID:

In order to measure partial refund use the ec:setAction command, set the action type to ‘refund’, provide the transaction ID, product ID(s) and product quantities to be refunded:

No comments:

Post a Comment