This WordPress plugin links to your Google Analytics account to retrieve the pageviews for your posts.
Therefore you can easily include this number in your blog for yourself or all of your visitors.
- Copy the google-analytics-post-pageviews folder into wp-content/plugins
- Activate the plugin through the Plugins menu
- Configure from the new Post Pageviews Settings submenu
I’ve been using Google Analytics on my site for years, and recently had a requirement to display total hits for all time for some pages. After doing some research it seemed like it could be very difficult. I tried a few things which didn’t work. This plugin saved the day!
Exactement ce que je cherchais, merci !
I was using earlier Count per day but it was bloating my database and reducing server performance badly resulting in much server cost. My site is a short story club which has more than 30,000 writers (with contributor access) and many readers. Every read was resulting in accessing huge database; it means multitude of write requests to database in a second. Moreover I was using Vaultpress for backup so every database update was triggering query to Vaultpress as well. I disabled this plugin a year ago and lost many writers as they were unhappy to not see reads of their stories.
But then after evaluating many plugins, I found this plugin. It does exactly what I wanted – get data from google analytics, cache it for specified time and provide easy interface to display reads in theme. I really thank the writer of the plugin.
However I wish to have an option to disable reads in posts admin menu. It may be good for single or fewer members site but definitely resource hungry option for big site. I had to comment code for this extra column in post admin area.
Only one complaint: I can’t find the link for contributing via paypal?
I was looking for this fonctionality since a long time and I was about to trying my own hacks. But I tryed this plugin and I ve been able to display my pageview on each post and on post lists. It even works for post types… Great !
I share my blog (French website) as an example of the pageviews 😉
You should describe the use of the plugin in details (on the plugin page), because it’s not really clear through the plugin.
Thanks a lot Maxime !
Contributors & Developers
“Google Analytics Post Pageviews” is open source software. The following people have contributed to this plugin.Contributors
Interested in development?
- Added a setting to add a trailing slash on slugs when fetching stats.
- Added a setting to select Unique pageviews.
- Added a setting toggle to hide Views column.
- Added a special setting to get main page pageviews, call
- The Views column can now be used to sort your articles!
- More intelligent way of getting Pageviews based on published dates.
- Preserve the old value if for some reason GA cannot fetch a new one.
- Fixed width on Views column.
- Fixed a case when GAPP could return an error or en empty string.
- Added a default value when the pageviews count cannot be refreshed.
- Adding 4 hour flush delay.
- Solving an issue with accented characters in URLs.
- Fix namespace unique ID first generation.
- Static translation namespace because i18n tools are dumb.
- Handling different DB namespaces for cache reset.
- Handling transients using other cache system.
- Reset cache also reset transient timeout values.
- Fixed wrong transient expiration delay.
- Try to display the cached number even if Google is disconnected.
- Check the array for websites results in the settings.
- Don’t disconnect the account if the API HTTP code is something else than 403.
- Returns API error message from Google API.
- Fixed an issue with Google auth token refresh.
- Removed Google auth cronjobs and improved async re-authentication.
- Added more details in the website selection.
- Redirection after Google connection to avoid mis-auth.
- Huge improvements on the Google authentication mechanism.
- Improved the way the Google token is refreshed.
- Added an anti-flood system when the Google API requests are not successful.
- Added a link to empty the pageviews cache.
- Using international number formatting for the views count, and adding a parameter to disable it on function call.
- Avoid unnecessary API calls when the post is not published.
- Improved Views column in Posts list.
- Improved permalink detection.
- Fixed some settings saving.
- Improved API calls and error handling.
- Minor but essential fix in the code snippet.
- Added an optional Views column in Posts list.
- Updated curl_ and file_ methods to WP_Http requests.
- Changed the Google URLs to match the new Google Developers Console.
- Specified a unique slug to prevent redirect_uri_mismatch.
- Fixed a bug that prevented the token refresh.
- First version. Enjoy!