ibericode / koko-analytics

Privacy-friendly, open-source and lightweight analytics for your WordPress site.
https://www.kokoanalytics.com/
GNU General Public License v3.0
368 stars 30 forks source link

Feature suggestion: Show pageviews column on post/page overview pages #61

Closed svatoupravdu closed 12 months ago

svatoupravdu commented 4 years ago

I'd love to see Hits column in admin post/page list just to have brief overview on how many times the articles have been read. WP Statistics plugin has such feature, just simple numbler would be enough, chart in column is not necessary.

screenshot-wp-statistics com-2018 12 04-16-14-56


Please vote on this feature suggestion using :+1: or :-1: below.

dannyvankooten commented 4 years ago

Hmm, interesting. For what time period are those hits though? Should it be configurable from the UI?

Verstuurd vanaf mijn iPhone

Op 5 apr. 2020 om 08:59 heeft svatoupravdu notifications@github.com het volgende geschreven:

 I'd love to see Hits column in admin post/page list just to have brief overview on how many times the articles have been read. WP Statistics plugin has such feature, just simple numbler would be enough, chart in column is not necessary.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

danielrunvegan commented 4 years ago

I like this idea, too! Maybe we could have an option to choose a default time period in the settings and use it for both the main chart view and this new column in the post/page list?

svatoupravdu commented 4 years ago

For me personally I don't need time period setting, total hits since ever is enough, just to keep things silly simple. Thanks!

kamauwanjoroge commented 4 years ago

I support this. Even if possible, @dannyvankooten could implement a shortcode to show the views on the frontend per post.

svatoupravdu commented 3 years ago

I've been collecting stats for last 6 months and I still miss the column with total hits count most. The column could still be optional though, there's an option pane above posts list in admin which could bear such checkbox.

svatoupravdu commented 3 years ago

Never mind, I achieved my goal by installing WP Code Snippets plugin and enabling this snippet for admin area only:

add_filter('manage_post_posts_columns', function($columns) {
    return array_merge($columns, ['pageviews' => __('Pageviews', 'textdomain')]);
});

add_action('manage_post_posts_custom_column', function($column_key, $post_id) {
    global $wpdb;
    if ($column_key == 'pageviews') {
        echo $wpdb->get_var(
            $wpdb->prepare( "SELECT SUM(pageviews) FROM wp_koko_analytics_post_stats WHERE id = $post_id" )
        );
    }
}, 10, 2);
larsschafer commented 3 years ago

https://wordpress.org/support/topic/counter-behind-the-postings/#post-14611944

dannyvankooten commented 12 months ago

Moved to #204