Hello Fernanda,
if you haven’t changed the default behavior (using the hook statify__skip_tracking), Statify will not track views by logged in users (cp. Statify, FAQ section, 1st question).
Cheers
Patrick
Edit: Oops, I read over the word “not“…
Answer below solves the opposite, track uathenticated users 😉
———-
Yes, adding something simple like
return is_logged_in() ? true : null;
but be aware that this skips all following default filters is a user is logged in. Consider picking some additional filters from the highlighted lines:
https://github.com/pluginkollektiv/statify/blob/master/inc/class-statify-frontend.php#L161-L175
Assuming authenticated users are usually no spam bots or crawlers, a simple error and feed exclusion might do the job here:
add_filter(
'statify__skip_tracking',
function() {
if ( is_logged_in() ) {
// Track logged in users, excluding feed, preview, error and search (skip otherwise)
return !is_feed() && !is_preview() && !is_404() && !is_search();
}
// Continue regular processing.
return null;
}
);
-
This reply was modified 7 years, 9 months ago by
Stefan Kalscheuer. Reason: Answered wrong question
Perfect, thanks for the quick replies. I guess the plug-in comes with the settings I need as default. 😉
thank you for your work and this nice plug-in.
cheers!
Fernanda