How count the page views of my Octopress blog?

I would like to add a simple counter to my blog posts. That way, each blog post has its own counter and can display how many times the post was clicked.

How can I achieve that with Octopress? Any ideas?

Thanks in advance for any tips!



The best way in my opinion would be to setup Google Analytics on your blog by placing the Analytics code at the bottom of your _layouts/default.html file.

It won't allow others to see how many visits you have had per post, but you personally will be able to view that data and lots more.

For others to see also, you can use a third-party API that uses JavaScript. The third-party service tracks pageviews for you and then provides you with a JavaScript snippet that you paste your sidebar or where ever you want the pageviews to show up. StatCounter is an example (didn't verify if it is a good service or not).

This is a common method of adding dynamic-ish features to static sites like those generated by Jekyll. Often people do this same technique to add comments to their blogs with Discus.


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.