: Google reverse an analytic Possible Duplicate: When reversing a Google Analytics e-commerce transaction is the per-unit price positive or negative? I am confused about what code must
Possible Duplicate:
When reversing a Google Analytics e-commerce transaction is the per-unit price positive or negative?
I am confused about what code must be executed to reverse a google analytic. I have the following code pasted within a test page:
<body onLoad=”function()”>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25305776-3']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'11455', // order ID - required
'-42.38', // total - required
'-2.38', // tax
'-15.00' // shipping
]);
_gaq.push(['_addItem',
'11455', // order ID - necessary to associate item with transaction
'Evan Turner Turningpoint™ Basketball Pants', // product name
'25.00', // unit price - required
'-1' // quantity - required
]);
_gaq.push(['_trackTrans']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
Is this correct? Thanks!
More posts by @Goswami781
1 Comments
Sorted by latest first Latest Oldest Best
Using the link provided by Dan, support.google.com/analytics/bin/answer.py?hl=en&answer=1037443, the title of the question should probably "How to reverse an e-commerce transaction in google analytics"
For example someone cancels an order, this would capture that so google analytics has correct information.
Looking at the code, one thing is missing from "_gaq.push(['_addItem',"
The minus sign in '25.00', so it should be:
_gaq.push(['_addItem',
'11455', // order ID - necessary to associate item with transaction
'Evan Turner Turningpoint™ Basketball Pants', // product name
'-25.00', // unit price - required
'-1' // quantity - required
]);
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.