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

My problem is with the tracking of my e-com. Conversion doesn't work. I did it like in the guide of google.

The debug console doesn't show any problems.

My code:

    <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXXXX-1']);
  _gaq.push(['_trackPageview']);

try{
 _gaq.push(['_addTrans',
      '<?php echo $id_eco ?>',            // transaction ID - required
      'Bauer und Boecker',  // affiliation or store name
     '<?php echo str_replace(",",".",$brutto_eco) ?>',           // total - required
      '',            // tax
      '',           // shipping
      '',        // city
      '',      // state or province
      ''              // country
    ]);


   // add item might be called for every item in the shopping cart
   // where your ecommerce engine loops through each item in the cart and
   // prints out _addItem for each 
 _gaq.push(['_addItem',
     '<?php echo $id_eco ?>',           // transaction ID - necessary to associate item with transaction
      '<?php echo $id_eco ?>',           // SKU/code - required
      '<?php echo $bezeichnung_eco ?>',        // product name
      '',   // category or variation
      '<?php echo str_replace(",",".",$einzelpreis_eco) ?>',          // unit price - required
      '<?php echo $menge_eco ?>'               // quantity - required
   ]);

_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
} catch(err) {console.log(err);}

  (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>

Any ideas?

share

migration rejected from stackoverflow.com Dec 10 '13 at 15:11

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by Stephen Ostermiller Dec 10 '13 at 15:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be off-topic because it is unlikely to help anybody else. Examples include individual website reviews for SEO purposes and general website troubleshooting." – Stephen Ostermiller
If this question can be reworded to fit the rules in the help center, please edit the question.

comments disabled on deleted / locked posts