Hi!
If someone is interested, here is the code for activating GA Ecommerce functionality. It is for v1.9, I don't know if applies for other, I guess for 2.x it doesn't.
Just Copy/Paste it to "CheckoutCompleted.ascx" (of course only the code between <script>...</script> is important and yes, change "UA-XXXXXX-X" with your GA ID):
<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Modules.CheckoutCompletedControl"
CodeBehind="CheckoutCompleted.ascx.cs" %>
<%@ Register TagPrefix="nopCommerce" TagName="OrderDetails" Src="~/Modules/OrderDetails.ascx" %>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'<%= NopContext.Current.User.Orders[0].OrderId.ToString() %>', // order ID - required
'Actionmama', // affiliation or store name
'<%= NopContext.Current.User.Orders[0].OrderTotal.ToString() %>', // total - required
'<%= NopContext.Current.User.Orders[0].OrderTax.ToString() %>', // tax
'<%= NopContext.Current.User.Orders[0].OrderShippingInclTax.ToString() %>', // shipping
'<%= NopContext.Current.User.Orders[0].ShippingCity.ToString() %>', // city
'<%= NopContext.Current.User.Orders[0].ShippingStateProvince.ToString() %>', // state or province
'<%= NopContext.Current.User.Orders[0].ShippingCountry.ToString() %>' // country
]);
// add item might be called for every item in the shopping cart
// where your ecommerce engine loops through each item in the cart and
// prints out _addItem for each
<% foreach (NopSolutions.NopCommerce.BusinessLogic.Orders.OrderProductVariant item in NopContext.Current.User.Orders[0].OrderProductVariants) { %>
_gaq.push(['_addItem',
'<%= NopContext.Current.User.Orders[0].OrderId.ToString() %>', // order ID - required
'<%= item.ProductVariant.SKU.ToString() %>', // SKU/code - required
'<%= item.ProductVariant.Product.Name.ToString() %>', // product name
'<%= item.ProductVariant.Product.ProductCategories[0].Category.Name.ToString() %>', // category or variation
'<%= item.UnitPriceInclTax.ToString() %>', // unit price - required
'<%= item.Quantity.ToString() %>' // quantity - required
]);
<% } %>
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<div class="checkout-data">
<div class="order-completed">
<div class="body">
<b>
<%=GetLocaleResourceString("Checkout.YourOrderHasBeenSuccessfullyProcessed")%></b>
<p>
<%=GetLocaleResourceString("Checkout.OrderNumber")%>:
<asp:Label runat="server" ID="lblOrderNumber" />
</p>
<p>
<asp:HyperLink runat="server" ID="hlOrderDetails" Text="<% $NopResources:Checkout.OrderCompleted.Details %>" />
</p>
</div>
<div class="clear">
</div>
<div class="select-button">
<asp:Button runat="server" ID="btnContinue" Text="<% $NopResources:Checkout.Continue %>"
OnClick="btnContinue_Click" CssClass="orderprocessedcontinuebutton" />
</div>
</div>
</div>
Hope it helps!
Cheers, Matic