The Octopress blog engine makes it easy to enable Google Analytics for your site.
First thing to do is to edit the _congif.yml file that is located in the root folder of the octopress source tree. Locate the line with the key google_analytics_tracking_id and add your tracking id that you have created on the Google Analytic site. This might be all you need to do to make the tracking working for your site, however sometimes you will need to do some extra configuration, especially if you are hosting your site on github pages like this site.
1 2 3
The code above is only showing small section of the html file mention above. However it’s the second line that has to be added manually for supporting sites with subdomains.
This should be enough for enabling Google Analytics on your site.