Hi, I have to insert Google Analytic Tracking Code to MoU MyOpenUniversity.com , the web hosting supports PHP, so is there any PHP code by using which i can automatically insert the Google Analytic Tracking Code into every HTML page? cheers
Follow this URL http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55504 Everything's been explain clearly in details... hope this help.
Yeah, that guide explains everything. You can always have a separate "footer.htm" or "footer.php" and insert the code into just that. Saves you the time from having to insert it into every single page
your pages seem to end in .html rather than .php so you will need to amend your htaccess file to ensure they get treated like php pages http://www.indianwebseo.com/seoblog/treat-html-pages-as-php-page cheers
Thank you for the reply, the reason i mentioned the PHP thing cuz someone told me that it can be done using Server Side Include but then they mentioned for that i have to rename all the pages from HTML to SHTML which would be pretty tedious process so i didn't go with that one. My website is a static one rather than dynamic. All the pages were created and then uploaded to the server so i think the info on the link dose not imply on the pages of the website.
I have searched my Directory where my files are at, there is no such file like called htaccess in any of the Dirs. P.S:- I was looking for the htaccess file in my File Manager, am i looking for it in the the place? Sorry i don't know much about Web Developing.
If there is an .htaccess file already you should see it in your file manager If there isn't, you need to create one - search on 'create an htaccess file' for information - it's straightforward but needs to be exactly right. Check your site as soon as you've added it, to check all is well. edit: you'll then need to do a bit of research on php 'include' and 'require' functions. Time spent on this will be time extremely well spent - no more sitewide 'find and replace' when you want to change the heder, footer, adsense ads etc
If you have more than a dozen pages then you should be using some kind of CMS, custom or bought/downloaded as a package. In PHP you can use templates for content common to all pages, in which you would insert the tracking code. On a Windows server running ASP.NET you want Master Pages. As a short-term fix you could just do a quick search and replace. Open all your documents in a text editor such as EditPad Pro (free trial that doesn't expire) and do a search and replace on "</body>" replacing it with: "</body> Tracking code here" You could move to using PHP templates using this same technique. Equally, I'm sure there are loads of free little applications out there which will let you change the file extension for a large number of files in one go.
no matter if it's static html files or PHP based you still need to add even the include line if used PHP or simply add the tracking code provided by analytics instep to track every single page. So, sorry to say that but there is no easy way to do it