Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an ecommerce site, when customers complete a transaction we pass the Google analytics calls for _addTrans and _addItem

The _addItem call is made individually for each item ordered, so if a customer ordered 5 items there will be 5 calls made.

However if a customer orders a large number of items, because each item is called individually on the thankyou page, there is a high chance the customer will navigate away from the page before all the calls to GA have been made.

Does anyone know if it is possible to send all items ordered in one _addItem call to GA using an array and matched pairs?

for example if a customer orders 2 items the call could look something like

_addItem(transactionId, sku, name, category, price, quantity)

_addItem([id1,id2], [sku1,sku2], [prod1,prod2], [cat1,cat2], [2,3], [1,2])
share|improve this question

migrated from stackoverflow.com Oct 1 '13 at 20:31

This question came from our site for professional and enthusiast programmers.

Sorry @confidentjohn for this getting moved. I disagree, but that's moot now. In any case, how many items are we talking here? I'd also be concerned about rate limiting in GA. – MisterPhilip Oct 1 '13 at 20:41
Hi @MisterPhilip I disagree too, its absolutly a programming question, anyway thank you for looking at this. We can quite easily take orders where there are 30+ individual items, so if a customer leaves the thank you page, i can get partial item data for an order. – confidentjohn Oct 2 '13 at 9:02

John, yes it is :)

GA currently don't support multi arrays but on the new ecommerce tag, it does.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.