How to add Google Analytics to every page on your osCommerce eCart
Posted On Saturday, January 5, 2008 at at 1/05/2008 04:25:00 AM by nullFirst thing you need to do is to open an account with Google, you can do that here http://www.google.com/analytics/
Once you have an account you will be given a snippet of code to install on each page you want tracked. On a normal HTML page you will place this just before the <./body> tag at the bottom of each page. You may read on some other sites that should place this at the top of the page, you should ignore such advice because if it's placed at the top of a page and there is a delay in the communication with the Google server then your page won't load load until it's finished, resulting in slow page load times and annoyed customers. If placed at the bottom, then the page will load first and be usable before Google has done it's bit.
The code snippet looks something like this
At the bottom of which you will see something like this.
if ($banner = tep_banner_exists('dynamic', '468x50')) {
?>
echo tep_display_banner('static', $banner); ?>
}
?>
if ($banner = tep_banner_exists('dynamic', '468x50')) {
?>
echo tep_display_banner('static', $banner); ?>
}
?>