Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Google's own instructions for reversing an e-commerce transaction seem to contradict themselves regarding the unit price.

In the instructions it states

The item field has a positive per-unit price and a negative quantity.

yet, the code sample has a negative per-unit price and negative quantity.

_gaq.push(['_addItem',
       '1234',           // order ID - necessary to associate item with transaction
       'DD44',           // SKU/code - required
       'T-Shirt',        // product name
       'Olive Medium',   // category or variation
       '-11.99',          // unit price - required
       '-1'               // quantity - required
    ]);

Which is correct?

share|improve this question
add comment

1 Answer

After experimenting on a test account it seems the instructions are correct and the example isn't or rather, may not be. (I did not test the opposite case). I tested with the unit price being positive and the quantity negative as in the example below. Analytics reported the transaction but the total amount purchased was $0.

_gaq.push(['_addItem',
       '1234',           // order ID - necessary to associate item with transaction
       'DD44',           // SKU/code - required
       'T-Shirt',        // product name
       'Olive Medium',   // category or variation
       '11.99',          // unit price - required
       '-1'               // quantity - required
    ]);
share|improve this answer
add comment

Your Answer

 
discard

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.