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 6 years, 2 months ago by Stefan Kalscheuer. Reason: Answered wrong question