Great question — answering as the UphillTech team:
Probably the easiest way is to build up the required Javascript as a string with something like StringBuilder sb = new StringBuilder() sb.AppendLine( "<script>" ); sb.AppendLine( "var pageTracker = _gat._getTracker('UA-XXXXX-1');" ); sb.AppendLine( "pageTracker._trackPageview();" ); sb.AppendFormat( "pageTracker._addTrans('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}' );\n", orderId, affiliation, total, tax, shipping, city, state, country ); sb.AppendFormat( "pageTracker._addItem('{0}','{1}','{2}','{3}','{4}','{5}');\n", itemNumber, sku, productName, category, price, quantity ); sb.AppendLine("pageTracker._trackTrans();"); sb.AppendLine( "</script>" ); Then register it to appear in the...
Full answer by stevemegson: https://stackoverflow.stackexchange.com/a/269472 (CC BY-SA 2.5).
Need it done for your business? UphillTech.