Mobile app version of vmapp.org
Login or Join
Carla537

: When reversing a Google Analytics e-commerce transaction is the per-unit price positive or negative? Google's own instructions for reversing an e-commerce transaction seem to contradict themselves

@Carla537

Posted in: #Analytics #Google #GoogleAnalytics

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Carla537

1 Comments

Sorted by latest first Latest Oldest Best

 

@Carla537

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 [CO].

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme