Track purchases by SKU in Google Analytics
<p>Our products are apparel, so we have lots of sizes and color variants that roll up under a single product id. </p>

<p>We have Google Tag Manager integrated with Google Analytics and Enhanced Ecommerce. On the product detail page, the product id (parent level, no variants) is pushed to the datalayer in a sku variable. On the confirmation page, the dataLayer > transactionProducts is populated with an array of each sku ordered.  SKU is also at the parent level.  Hence, we can see a product page conversion rate based on sku ordered vs the sku passed for product impression. </p>

<p>Google Analytics will only take the first instance of a SKU value and ignore the rest.  So, in the below example, Google Analytics will show 3 units of SKU 123 were sold in this order. </p>

<pre><code>dataLayer = [{
    "pageName":"confirmation",
    "pageCategory":"checkout",
    "transactionProducts": [{
        "sku":"123",
        "vn":"123:black",
        "price":10,
        "quantity":3,
        "currency":"USD"
    },{
        "sku":"123",
        "vn":"123:white",
        "price":10,
        "quantity":2,
        "currency":"USD"
    }]
}];
</code></pre>

<p><strong>My question is this: how can we track purchases as in the example above such that total quantity of SKU 123 is recorded in GA?</strong> </p>

<p>By my lights, we either 1. Change what SKU means on the product page vs the confirmation page, and keep SKU as the parent in the former and update SKU to be vn on the latter or 2. Give up the ability to see purchases of variants and push parent-level sum totals into transactionProducts in the dataLayer on the confirmation page.  If we do 1, then I fear we'll loose the product page impression conversion rate metric. If we do 2, then we loose visibility into purchases by variant. Is there any other option for tracking total SKU's purchased that I am missing?  </p>