To send more than one item in a single e-commerce transations simply
call addItem for each item you want to add.
If your item(s) are stored in an array (named "items") you can do
something like this
pageTracker._addTrans("orderId", "affiliation", "subtotal", "tax",
"shipping", "city", "state", "country");
for (var i in items) {
pageTracker._addItem("orderid", items[i]["sku"], items[i]["name"],
items[i]["category"], items[i]["price"], items[i]["quantity"]);
}
On May 23, 7:03 am, KeepItLucid wrote:
> How the code is written will depend on the shopping cart software that
> you are using. I use Pinnacle Cart and they list the code here on
> their website:
> http://www.pinnaclecart.com/kb/questions/39/How+do+I+use+Google+Analy...
> Here's the code:
> <body onLoad="javascript:__utmSetTrans()">
> <form style="display:none;" name="utmform">
> <textarea id="utmtrans">UTM:T|{$order_id}|{$affiliation}|
> {$order_amount}|{$tax}| {$shipping_amount}|{$city}|{$region}|
> {$country}
> {foreach from=$items item="item"}
> UTM:I|{$order_id}|{$item.sku}|{$item.product_name}|
> {$item.catalog_name}|
> {$item.price}|{$item.quantity}
> {/foreach}
> </textarea>
> </form>
> <script type="text/javascript">
> this.document.body.onload="javascript:__utmSetTrans()";
> </script>
> Check with your shopping cart provider to see what works for your
> cart. If they aren't helpful, then you'll want to post the name of
> the shopping cart software here to see if anyone else has had
> experience with it.
> -
> Benhttp://www.keepitlucid.com
> On May 22, 12:18 pm, CoadMunky13 wrote:
> > I've been searching and have not found much on tracking multiple items
> > using the analytics e-commerce api.
> > We have a fairly simplistic shopping cart which puts up a read only
> > receipt for the buyer to print when their order is complete. On that
> > form are hidden fields containing arrays of text strings which I parse
> > out in the backend to create the table of their order.
> > Is there any way to:
> > 1-track multiple items using the analytics e-commerce api?
> > 2- send an array of values instead of parsing out each individual
> > value to send via the additem api?
> > Most of what I've seen out there in the way of blogs and such has
> > shown only the simple, static type of example for a single item. Any
> > help at all is greatly appreciated.