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

I am having issues with Google Analytics eCommerce tracking. On certain days it the eCommerce tracking is returning a value of $1.00 of revenue which is impossible because it is a hotel booking website. I'm am so puzzled and not knowing where to go next with this.

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); })();

share|improve this question
add comment

migrated from stackoverflow.com Sep 24 '13 at 2:04

This question came from our site for professional and enthusiast programmers.

1 Answer

Does anybody else have access to the code? Like a developer testing the website? For example, in a staging environment, sometimes I'll have a client create a item that costs 1.00 to test ecommerce tracking. If that's the case, just create a filter excluding your developers IP address.

Also, where "${res.grandTotal}" is getting populate server-side, can you look to see if there are any $1.00 purchases?

share|improve this answer
    
There would not be any $1 purchases because nothing is on sale for $1.00 on our hotel's website. I will be in touch with the developer about a possible staging environment but this issue is still not solved =(. –  crayden Sep 19 '13 at 22:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.