现在在这个问题上挣扎了一段时间。在电子商务插件上,用户购买后,分析代码被插入,然后用户被重定向。问题是结帐卡在白页上,我在页面源代码中只能看到分析代码。我假设在重定向发生之后,它会引发一个标头已发送错误。这是页面的视图源:
<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_setDomainName', 'domain.com']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'61', // order ID - required
'outdoor-om™', // affiliation or store name
'9.95', // total - required
'0.00', // tax
'0.00', // shipping
'St Petersburg', // city
'Missouri', // state or province
'US' // country
]);
_gaq.push(['_addItem','61','','XYT','Fresh','9.95','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);
})();
</script>