Google analytics e-commerce tracking
Posted
by
crayden
on Pro Webmasters
See other posts from Pro Webmasters
or by crayden
Published on 2013-09-18T17:39:39Z
Indexed on
2013/10/24
4:09 UTC
Read the original article
Hit count: 253
google-analytics
|analytics
Good morning or afternoon wherever you are,
I am having issues with Google Analytics e-commerce tracking. On certain days it the e-commerce tracking is returning a value of $1.00 of revenue which is impossible because it is a hotel booking website. Im am so puzzled and not knowing where to go next with this. Any assistance is greatly appreciated. Thank you!
Here is some code that might help, I received this from our contact who develops the booking engine.
This is included on every page except the reservation confirmation page:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26956700-1']);
_gaq.push(["_setDomainName", "none"]);
_gaq.push(["_setAllowLinker", true]);
_gaq.push(['_trackPageview']);
(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>
This is included only on the reservation confirmation page: (The "${res.xxx}" elements are replaced on the server side with reservation details.)
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(["_setAccount", "UA-26956700-1"]);
_gaq.push(["_setDomainName", "none"]);
_gaq.push(["_setAllowLinker", true]);
_gaq.push(["_trackPageview"]);
_gaq.push(["_addTrans", "${res.confirmationNumber}", "Sunshine", "${res.grandTotal}", "${res.totalPriceTax}", "", "", "", ""]);
_gaq.push(["_addItem", "${res.confirmationNumber}", "${res.roomType}", "", "", "${res.totalPrice}", "1"]);
_gaq.push(["_addItem", "${res.confirmationNumber}", "Options", "", "","${res.otherChargeChoices.totalCostExclTax}", "1"]);
_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); })();
© Pro Webmasters or respective owner