Google Analytics for Github Pages With Octopress
I wanted to setup google analytics for my octopress blog hosted on github pages. My situation was a little different than some of the existing tutorials because I’m using a custom domain, not the standard username.github.io
domain. To get everything setup and working I did the following:
- Create a Google Analytics account.
- Tell your analytics account to monitor your custom domain. For me this was my
www.mattnedrich.com
domain, not themattnedrich.github.io
one. - Update your Octopress
_config.yml
file to include your analytics tracking id by setting thegoogle_analytics_tracking_id:
property. This tracking id will look something likeUA-23414877-5
- Generate and deploy your site
There are several posts online that talk about modifying the google_analytics.html
octopress file. If you are using a custom domain with your github page you don’t have to do this (or at least I didn’t have to).