How do i check my code? :blush:
Printable View
Ah, is this the sorce code i should have? Found this on my site, i have put XX and asterix to hide tracking number:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'XX-********-*']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
(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>
</head>
If you already have 1.2.4 then there is no need to run any SQL patch. Just upload the files included in the package (overwriting those already in place) and then remove the lines of code in the file you mentioned (that portion is now covered in an override file found int he jscript directory with the new package.)
This should be active in the zen downloads area, but if not, you can get it from here: (posted this link with a few other update notes a page or so ago.)
http://www.zencartoptimization.com/downloads/
I've just downloaded the Simple Google Analytics mod v1.2.5
What pages is it advised to place the Google Analytics Code?
One of the pages i understand the code should be placed is the
/common/tpl_main_page.php
Where in this page does the following code go?
Google says to place the code just before the tag </header>PHP Code:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_trackPageview']);
(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>
Unfortunately that tag does not exist.
Any help would be appreciated
Hi
After downloading the Simple Google Analytics v 1.2.5
and installing the following code has been included in the source code:
Where have I made a mistake?PHP Code:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXXXXXX-X");
pageTracker._initData();
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
(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>
pageTracker._trackPageview();
pageTracker._trackPageLoadTime();
</script>
it looks like some duplications.
I have placed the google analytics code in the custom area within the admin configuration/ google analytics