Upgrading Google Analytics in Octopress

September 8, 2014
google analytics, universal analytics

Google Analytics for Octopress hasn’t integrated the latest update to include Demographics and Interest reports. In Octopress, Google Analytics code resides in source/_includes/google_analytics.html

According to Google, one line change will include the demographics and interest reports to your analytics. Following is the diff of my source/_includes/google_analytics.html

Just replace the line

ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';


ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';

And you are done. It will take upto 24 hours for the new reports to start appearing.

I have opened a pull request for this upgrade. If this gets merged, these reports should be included by default.