computer

Upgrading Google Analytics in Octopress

By Ganessh Kumar1 min read
  • 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';

to

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.

  • Octopress Gist vs Include-code

    Explore Gist's impact on Octopress blog performance and discover alternatives like Include-code to improve load time.

    • github
    • octopress
  • SEO in Octopress

    Learn how to optimize your Octopress blog for search engines by adding meta keywords and descriptions to your posts.

    • seo
    • blogging
    • octopress

Keep reading

I write about full-stack development, developer tooling and the problems I run into building things. Here is everything else on the blog.