I went directly to Google for assistance and they got us in touch with one of their tech programmers that helped us with the code. I had started with
http://misterphilip.com/universal-analy ... /ecommerce and was able to get the hard coded data to appear in our Google Analytics. So I sent that and the GoogleAnalyticsWidget code, which showed the parameters used to pull the data out and send over to analytics previously, to their programmer.
This was the code that they sent back to me and it worked! (We didn’t have categories or store name before, and we personally didn’t need it now, so that doesn’t come through.)
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//
www.google-analytics.com/analytics.js','ga');
// Create the tracker\
var orderid=parseInt(document.getElementById("ctl00_wpm_ReceiptPage_ctl02_PageHeaderPanel").getElementsByTagName("h1")[0].innerHTML.replace("View Order","").replace("#","").trim());
var shipping=parseFloat(document.getElementById("ctl00_wpm_ReceiptPage_ctl02_OrderTotalSummary1_Shipping").innerHTML.replace("$",""))
var total =parseFloat(document.getElementById("ctl00_wpm_ReceiptPage_ctl02_TotalCharges").innerHTML.replace("$",""));
var tax =parseFloat(document.getElementById("ctl00_wpm_ReceiptPage_ctl02_OrderTotalSummary1_Taxes").innerHTML.replace("$",""));
ga('create', UA-XXXXX-Y');
// Fire off a pageview
ga('send', 'pageview');
// Include the ecommerce plugin
ga('require', 'ecommerce', 'ecommerce.js');
// Initialize the transaction
ga('ecommerce:addTransaction', {
'id': orderid, // Transaction ID*
'affiliation': "Store Name ", // Store Name
'revenue': total, // Total
'shipping': shipping, // Shipping
'tax': tax // Tax
});
// Add a few items
var table=document.getElementById("ctl00_wpm_ReceiptPage_ctl02_ShipmentRepeater_ctl00_ShipmentItemsGrid")
for (var r = 1, n = table.rows.length; r < n; r++) {
ga('ecommerce:addItem', {
'id': orderid, // Transaction ID*
'sku': table.rows[r].cells[1].getElementsByTagName("span")[0].innerHTML, // Product SKU
'name': table.rows[r].cells[2].innerHTML, // Product Name*
'category': " ", // Product Category
'price': parseFloat(table.rows[r].cells[3].getElementsByTagName("span")[0].innerHTML.replace("$","")), // Price
'quantity': table.rows[r].cells[0].getElementsByTagName("span")[0].innerHTML // Quantity
});
}
// Send off the transaction
ga('ecommerce:send');
</script>
Hopefully this will help others, or at least get them started!