Simplest way to display pageview count publicly?

On my WordPress blog, I’d like each blog post to show P, the pageview count of that blog post in the past N days.

N would be the same number across the entire blog e.g. 30 as in ‘the past 30 days.’

P is specific to each blog post, so would be different for each post.

What would be the simplest way to call the Piwik API in PHP to display P in my WordPress theme?



You can use the API:

Actions.getPageUrl() given a URL will return page views, time on page, etc.

You can get the data in serialized PHP or JSON and display it in WP.

If you can make it a public wordpress plugin I’m sure others would enjoy it :slight_smile: