This is a quick overview about Google Analytic specifically for developers.
It might be too technical for some to even digest. Anyway here’s what you need to do. You can put either one of the scripts.
In a nutshell: Google Analytics is a free service offered by Google that generates detailed statistics about the visitors to a website. Its main highlight is that the product is aimed at marketers as opposed to webmasters and technologists from which the industry of web analytics originally grew. It is the most widely used website statistics service, currently in use at around 57% of the 10,000 most popular websites. (source from Wikipedia)
The Traditional Way
<script type=”text/javascript”>
var gaJsHost =(("https:"== document.location.protocol) ? "https://ssl.":"http://www.");