It does not matter where the code is placed as long as the function is defined before it is used. In ShopSite 11sp2 this is how the info displays on the thankyou screen.
- Code: Select all
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-123456-1']);
_gaq.push(['_trackPageview']);
</script>
<script type="text/javascript">
(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>
<script type="text/javascript">
_gaq.push(['_addTrans', "1346","","6.27","0.07","5.20","Orem","UT","Australia"]);
_gaq.push(['_addItem', "1346","SKU2134","!test","Products","1.00","1"]);
_gaq.push(['_trackTrans']);
</script>
</body>
So the function is defined before the _qaq.push is used.
If you are not seeing conversion coming through then something else is not configured correctly. There are lots of people who are using GA with ShopSite so it is not a general problem that you are encountering.
What type of Google Analytics are you using? They have had at least 3 different versions.
Did you enter your information into ShopSite on Merchandising > Google Services > Google Analytics screen and letting ShopSite generate the code? Or are you trying to put it into the html pages yourself, either through editing the html, entering it in a text field in ShopSite or through a custom template?
Do you have the same domain for your store pages and shopping cart and thank you screens or are there different domain names?