Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 501
Tom Avatar asked Apr 11 '13 20:04

Tom


People also ask

How do you count page views?

The total number of page views divided by the total number of visits during the same timeframe. Sophisticated users may also want to calculate average page views per visit for different visitor segments. “Page Views” is a fairly generous measurement. If you land on a page, that's a pageview.


1 Answers

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.

like image 147
J W Avatar answered Oct 03 '22 23:10

J W