Removed analytics code for logged in users
-
Thanks alot for that simple plugin. However I wanted to remove the analytics code when a user was logged into wordpress.
I achieved this by replacing the lines 55-bottom from the current release (1.0.5) with this code:
function add_analytics_code(){ if (!is_user_logged_in()) { add_action('wp_head', 'googleanalytics'); } } register_activation_hook(__FILE__, 'activate_googleanalytics'); register_deactivation_hook(__FILE__, 'deactive_googleanalytics'); if (is_admin()) { add_action('admin_init', 'admin_init_googleanalytics'); add_action('admin_menu', 'admin_menu_googleanalytics'); } else { add_action('init', 'add_analytics_code'); } ?>
Would be glad if this change could make it to the code base (maybe the more sophisticated developer might introduce a checkbox in the options dialog or so…).
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Removed analytics code for logged in users’ is closed to new replies.