I can use this in the header or should I use the 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-xxxxxxx-x");
pageTracker._trackPageview();
</script>
or
<?php include($template->get_template_dir('tpl_footer_googleanalytics.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer_googleanalytics.php'); ?>
Got Baby Heels? Your Hooter Hider resource!
I have a subfolder www.wcironsales.com/store
For some reason I cannot get Analytics to work there, any ideas?
The index page is: http://wcironsales.com/store/index.php
The file I have placed the code is in tpl_main_page.php
The code I placed is:
<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">
try {
var pageTracker = _gat._getTracker("UA-6599933-6");
pageTracker._trackPageview();
} catch(err) {}</script>