Working with my E107 CMS I found it a bit of a challenge determining where to place the google analytics tracking code. After a bit of trial and error, I found that the best area of each php page is right before here:
require_once(FOOTERF);
So this is the product you'll end up with for successful implementation of your google analytics tracking code: ------- Your PHP
Closing PHP tag
?>
Google Tracking Code
Open PHP tag
<?
require_once(FOOTERF);
The rest of your PHP ------- Also with this method you don't have to worry about quotes and semi-quotes that are part of the Tracking Code interfering with your php.
And don't forget to exclude your IP address from being counted. Since you will probrably visit your website multiple times a day, you don't want that to inflate your statistics.
Here's how to exclude your IP address from Google Analytics:
1. Log in to your Google Analytics account. On the page where you’ve got website profiles, there’s Filter Manager on the bottom right. Click on it.
2. Click on “Add Filter” on the top right of the box.
3. Give the filter a name, select pre-defined filter, select the filters from the drop-down menus and enter your IP address. If you don't know what your IP address is got to http://whatismyipaddress.com
4. Select the website profile from the left and add it to the right.
5. Click save and you are done.
The visits from your computer should be excluded from the results now. AH