Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Need to pull Google Analytics from plugin based on user. WordPress

I'm using the Google Dashboard for WordPress plugin to track site activity.

The plugin is here:

[[LINK href="https://wordpress.org/plugins/google-analytics-dashboard-for-wp/"]]https://wordpress.org/plugins/google-analytics-dashboard-for-wp/[[/LINK]]

This plugin adds an analytics icon for each post type. When you sign into WP and click a custom post type, each post has the Analytics icon showing specific info for that post.

I need to make this available to authors when they sign in on their dashboard. I want them to only see the analytics for their specific content. My site is a business network where each user has a single profile. So I want them to see profile visit info when they sign in.

I'm not sure how difficult this is, so I'm setting the price to $25. If it takes more than that, whoever I go with will get my vote for the $25, and then I'll pay whatever else it requires.

You don't have to use the plugin above...I'm just hoping that since it's already displaying by post type, tying in the author won't be a huge deal.

*Also, with this I'm looking for an ongoing WP developer. I'm great at front end and normal PHP, but this stuff is over my head.

Answers (2)

2015-03-31

Arnav Joy answers:

Hello Kyler ,

Can you add me on skype : arnav.joy


Kyler Boudreau comments:

I'm messaging you.

2015-03-31

Jayaram Y answers:

You can restrict the authors to see all the posts.

By using the code below, user can see only his posts when logged in.


function posts_for_current_author($query) {
global $user_level;

if($query->is_admin && $user_level < 5) {
global $user_ID;
$query->set('author', $user_ID);
unset($user_ID);
}
unset($user_level);

return $query;
}
add_filter('pre_get_posts', 'posts_for_current_author');


Editor roles equates to levels 5 through 7, so anything lower then 5 is lower then an editor role...


Kyler Boudreau comments:

Jayaram,

That doesn't work for this situation. I did try it, but no dice. Thanks man.