2011-06-03 28 views
0

我已經等了超過72小時,但電子商務數據沒有被跟蹤。跟蹤在分析帳戶中啓用。跟隨谷歌電子商務分析代碼有什麼問題

<script type="text/javascript"> 
     var _gaq = _gaq || []; 
     _gaq.push(['_setAccount', 'UA-xxxxx-1']); 
     _gaq.push(['_setDomainName', '.welcome.com']); 
     _gaq.push(['_trackPageview']); 
     _gaq.push(['_trackPageLoadTime']); 

     _gaq.push(['_addTrans', 
       '650',   // order ID - required 
       'bags', // affiliation or store name 
       '19.99',   // total - required 
       '0', 
       '4.0',   // shipping 
       'Anchorage',  // city 
       'Alaska',  // state or province 
       'USA' 
       ]); 
     //Add each items in the order 
     _gaq.push(['_addItem', 
       '650', // order ID - necessary to associate item with transaction 
       '29',   // SKU/code - required 
       'bags set of 4',  // product name 
       'Cleaning Supplies', // category or variation 
       '15.99',   // unit price - required 
      '1' 
      ); 
     //Now submit the transaction 
     _gaq.push(['_trackTrans']); //submits transaction to the Analytics server 

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

    </body> 

回答

5

我認爲你缺少一個右括號:

//Add each items in the order 
    _gaq.push(['_addItem', 
      '650', // order ID - necessary to associate item with transaction 
      '29',   // SKU/code - required 
      'bags set of 4',  // product name 
      'Cleaning Supplies', // category or variation 
      '15.99',   // unit price - required 
     '1' 
      ]); //right here, missing closing bracket 
+0

的感謝!改變了代碼。希望一切都應該現在起作用。 – Anshu 2011-06-03 01:12:23

相關問題