I have a client with a private WordPress blog – that is to say, you need to log in to read it.
We are using Counterize to keep track of visits to the site and to find the most popular pages.
But now he wants to know which users are logging in, and perhaps how often they are logging in to read this blog.
I checked to see if there was any info in wp_usermeta ( like last-login-date ) but there doesn’t seem to be.
Any suggestions how to keep track of user’s activities?
Thanks
3 Answers
A basic user login tracker is pretty trivial to implement.
function track_user_login_wpse_100929($id,$user) {
$tracking = get_user_meta($user->ID,'tracking_key_name',true);
$tracking[] = time();
update_user_meta($user->ID,'tracking_key_name',$tracking);
}
add_action('wp_login','track_user_login_wpse_100929',1,2);
After that you just need to work out the details such as how long you are going to keep the history, what kind of reports you want to pull, that kind of thing.