You can track posts views with these functions. Create a new file and call it into your functions.php
after you collect enough data, you can create a meta box for Dashboard and you can use a chart module to view post views monthly/yearly etc.
add_action( 'wp_head', 'get_post_id' );
function get_post_id() {
$postID = get_the_ID();
return $postID;
}
function getPostViews() {
$postID = get_post_id();
$count_key = 'views';
$count = get_post_meta( $postID, $count_key, true );
if ( $count == '' ) {
delete_post_meta( $postID, $count_key );
add_post_meta( $postID, $count_key, '0' );
return __( '0', 'sagive' );
}
return number_format( $count, '0', ',', '.' ) . __( '', 'sagive' );
}
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
add_action( 'wp_head', 'setPostViews' );
function setPostViews() {
if ( ! is_home() && ! is_robots() && ! is_user_logged_in() ) {
$postID = get_post_id();
$count_key = 'views';
$count = get_post_meta( $postID, $count_key, true );
if ( $count == '' ) {
$count = 0;
delete_post_meta( $postID, $count_key );
add_post_meta( $postID, $count_key, '0' );
} else {
$count++;
update_post_meta( $postID, $count_key, $count );
}
}
}