Javascript GA电子商务代码问题

Javascript GA电子商务代码问题,javascript,google-analytics,Javascript,Google Analytics,我有一个电子商务代码,在这里我只传递交易ID和数量详细信息。但这并没有记录在GA API中。下面是代码 <script type="text/javascript" language="javascript"> var _gaq = _gaq || []; _gaq.push( ['mainind._setAccount', 'UA-12345-1'], ['mainind._setDomainName', '.abcd.com'], ['mainind._setAllowHash'

我有一个电子商务代码,在这里我只传递交易ID和数量详细信息。但这并没有记录在GA API中。下面是代码

<script type="text/javascript" language="javascript">
var _gaq = _gaq || [];
_gaq.push(
['mainind._setAccount', 'UA-12345-1'],
['mainind._setDomainName', '.abcd.com'],
['mainind._setAllowHash', false],
['mainind._trackPageview'],
['mainind._trackPageLoadTime']
);

_gaq.push(['_addTrans',
    '136069322',    
    '',                 
    '',                 
    '',                 
    '',                 
    '',                 
    '',                 
    ''                  
]);
_gaq.push(['_addItem',
    '136069322',                        
    '',                                     
    '',                                     
    '',                                     
    '',                                     
    '4' 
]);

_gaq.push(['_trackTrans']); 

(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();

var _gaq=_gaq | |[];
_推(
['mainid.\u setAccount','UA-12345-1'],
['mainind.\u setDomainName','.abcd.com'],
[mainind.[u setallowash',false],
['mainid.\u trackPageview'],
['mainind.\u trackPageLoadTime']
);
_gaq.push(['''u addTrans',
'136069322',    
'',                 
'',                 
'',                 
'',                 
'',                 
'',                 
''                  
]);
_gaq.push(附加项),
'136069322',                        
'',                                     
'',                                     
'',                                     
'',                                     
'4' 
]);
_gaq.push([''u trackTrans']);
(功能(){
var ga=document.createElement('script');
ga.src=('https:'==document.location.protocol?'https://ssl' : 'http://www“)+”.google analytics.com/ga.js';
ga.setAttribute('async','true');
document.documentElement.firstChild.appendChild(ga);
})();

请帮我解决这个问题

谢谢,
Ashok Verma

您必须为通过_setAccount('mainind')定义的同一跟踪器对象调用_addTrans、_addItem和_trackTrans命令:


var _gaq=_gaq | |[];
_推(
['mainid.\u setAccount','UA-12345-1'],
['mainind.\u setDomainName','.abcd.com'],
[mainind.[u setallowash',false],
['mainid.\u trackPageview'],
['mainind.\u trackPageLoadTime']
);
_gaq.push(['mainind.\u addTrans',
'136069322',    
'',                 
'',                 
'',                 
'',                 
'',                 
'',                 
''                  
]);
_gaq.push(['main.\u addItem',
'136069322',                        
'',                                     
'',                                     
'',                                     
'',                                     
'4' 
]);
_gaq.push(['mainind._trackTrans']);
(功能(){
var ga=document.createElement('script');
ga.src=('https:'==document.location.protocol?'https://ssl' : 'http://www“)+”.google analytics.com/ga.js';
ga.setAttribute('async','true');
document.documentElement.firstChild.appendChild(ga);
})();

另外请注意,和已弃用,应删除。

KD您能在这里帮助我吗?非常感谢。我会检查一下,然后告诉你。
  <script type="text/javascript" language="javascript">
var _gaq = _gaq || [];
_gaq.push(
['mainind._setAccount', 'UA-12345-1'],
['mainind._setDomainName', '.abcd.com'],
['mainind._setAllowHash', false],
['mainind._trackPageview'],
['mainind._trackPageLoadTime']
);

_gaq.push(['mainind._addTrans',
    '136069322',    
    '',                 
    '',                 
    '',                 
    '',                 
    '',                 
    '',                 
    ''                  
]);
_gaq.push(['mainind._addItem',
    '136069322',                        
    '',                                     
    '',                                     
    '',                                     
    '',                                     
    '4' 
]);

_gaq.push(['mainind._trackTrans']); 

(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();