2

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?

3

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
    ]);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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