Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Google Analytics


marleenverbeek

Recommended Posts

Posted

Hello,

 

I think it should be something really easy but I can't get it done! How do I install google analytics on my page?

I added on my footer page but when I upload it and check view source, I don't see it and also in my google report it does not show up.

 

Below I pasted my footer.php. I tried placing it on various places without interrupting the other code. After the footer.pho code is my google analytics code. Is there somebody who can tell me what I am doing wrong?

 

Thanks,

Marleen

 

Footer.php:

 

<?php

/*

$Id: footer.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

 

 

// START STS 4.5

if ($sts->display_template_output) {

// Get content here, in case column_right is not called.

if (!isset($sts->template['content']))

$sts->restart_capture ('content');

} else {

//END STS

 

 

require(DIR_WS_INCLUDES . 'counter.php');

?>

 

 

<table border="0" width="100%" cellspacing="0" cellpadding="1">

<tr class="footer">

<td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>

<td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>

</tr>

</table>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center" class="smallText"><?php echo FOOTER_TEXT_BODY; ?></td>

</tr>

</table>

<?php

if ($banner = tep_banner_exists('dynamic', '468x50')) {

?>

<br>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center"><?php echo tep_display_banner('static', $banner); ?></td>

</tr>

</table>

<?php

}

 

 

// START STS 4.1

}

// END STS 4.1

 

 

?>

<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-10573937-1");

pageTracker._trackPageview();

} catch(err) {}</script>

 

 

Google analytics 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">

try {

var pageTracker = _gat._getTracker("UA-10573937-1");

pageTracker._trackPageview();

} catch(err) {}</script>

Posted

With STS, you should put it in your STS template file rather than includes/footer.php, which STS does not use. You might get better help with that in the STS support thread.

Always back up before making changes.

Posted
You need to have the code in your "default" template. If you are using other templates on "front" level, like "index" etc, the you need to place the code there as well.

 

You don't need to place it in ay content templates

 

Hi,

 

I am using sts, so I placed in my sts template. I am only using one. And now it is actually showing up. So thanks so much!

I don't know why people say you have to place in it in your footer. Is that maybe of you are not using sts?

Anyway, thanks so much.

 

Regards,

Marleen

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...