I'm having trouble getting Google Analytics to track transactions for trading. Here is the code that I create on the order confirmation page.
I donโt know how to debug this either, I canโt find information on how to get error codes from google js. I would run it in the firebug console if I could. At this moment, I was fixated on how to act.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-########-#']);
_gaq.push(['_setDomainName', '.mydomain.com']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'117',
'StoreName.com',
'35.96',
'0',
'0',
'',
'',
''
]);
_gaq.push(['_addItem',
'117',
'1',
'1 Pack',
'Catagory5',
'35.96, // unit price - required
'1' // quantity - required
]);
_gaq.push(['_trackTrans']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https:
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
</script>
Thanks for any suggestions.
source
share