![]() |
|
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Zen Cart & osCommerce Tips, advice and help on how to use the most popular free E-commerce shopping carts available. |
![]() |
|
|
LinkBack (1) | Thread Tools | Display Modes |
|
|||
|
First 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 HTML Code:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2462717-1"; urchinTracker(); </script> At the bottom of which you will see something like this. PHP Code:
PHP Code:
__________________
Lawrence |
|
|||
|
Hi Lawrence
I look after an OSCOMMERCE site for a client but it would not appear that the file footer.php situated within INCLUDES is supporting my clients site. The footer information I do see seems to be editable in a file titled english.php that has a section contained within it saying define footer text and here I can edit text that I want to appear on every page. However, the actual footer file situated within INCLUDES looks nothing like what you refer too. Appreciate your advice on where I might be going wrong? |
|
|||
|
Hi ICTADVIS
It is possible that your client is running an older version of osCommerce than the one I used in my example so the code will be slightly different. The principle is still the same, place the Analytics code after the last ?> in includes/footer.php. To check it's actual position on a page, open the site in your browser then view the source for the page. It should appear just before the </body> tag.
__________________
Lawrence |
|
|||
|
One problem that you're likely to encounter if you use SSL on the server is that you will get a security error when your browser changes from http to https. To get around this, you use https://ssl.google-analytics.com/urchin.js instead of the normal Google address when in SSL mode. To enable OSC to switch between the two, you delete the urchin call from the example above and insert this snippet immediately before the last ?>
PHP Code:
PHP Code:
__________________
Lawrence |
![]() |
LinkBacks (?)
LinkBack to this Thread: http://www.eshopforums.com/f13/how-add-google-analytics-every-page-your-oscommerce-ecart-106/
|
|||
| Posted By | For | Type | Date |
| javascript code in .php footer? | This thread | Refback | 05-10-2007 01:35 AM |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to add a linkable image to your sig | Nick | Forum Issues and Suggestions | 0 | 08-08-2007 07:13 AM |