In order to use Google Analytics, you need to register an account first. Then create a website profile for it. Finally, you need to insert the tracking code into your website. There are 2 tracking codes currently - Legacy Tracking Code (urchin.js) and New Tracking Code (ga.js). Be sure to use the New Tracking Code (ga.js) because it can gain access to a wide range of exciting new features as they become available.
So where should I put it? You should put it into every webpage you want to track immediately before the </body> tag. Most of the websites use a footer template to display the bottom website layout. Just copy and paste the tracking code there.
Example, put the code right before </body>
<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”>
var pageTracker = _gat._getTracker(”UA-xxxxxxx-x”);
pageTracker._initData();
pageTracker._trackPageview();
</script>
</body>
</html>
Related Topics:
Read other Google Analytics related posts
Tags: tracking code
4 Responses
Najmi
July 1st, 2008 at 11:55 pm
1footer.php?
oic, got it! thank you so much for the info!
^^
Jayce
July 2nd, 2008 at 5:58 am
2You are most welcome.
Nilai-3
November 21st, 2008 at 8:18 am
3Hi, do we have to paste all the codes in every page of our single domain or profile? All of the pages? Wow?
Do we need to tell Google anaytic to track the addtional code that we add in later on for a single profile?
Thanks
spBlogger
November 23rd, 2008 at 6:00 pm
4Yes. Paste it on every pages that you want to track.
No need to ‘tell’ Google Analytics for additional code.
RSS feed for comments on this post · TrackBack URI
Leave a reply
Categories
Archives
Chat Chat Chat...
Jayce Ooi's Paradise
Sponsored links