You can find the the plugin on wpmudev.org at the following URL:
http://premium.wpmudev.org/project/google-analytics-for-wordpress-mu-sitewide-and-single-blog-solution
Multisite Analytics
It’s great to offer your users Google Analytics, but it’s even better to be able to offer it to individual bloggers AND at the same time capture sitewide stats for yourself!
There are not many options for this plugin and today we ran into a problem where we didn’t really want the website to track visits and stats from “administrators”. Removing the plugin just for that role was quite a difficult task. Put the following code in your themes functions.php file and you too can filter out traffic from the GA profile to give yourself a better idea of the true visits and conversions on your website.
//modify the WPMUDEV.org GA plugin so it only loads for visitors that are NOT admins, //TODO: needs modified for super-admins if(class_exists('Google_Analytics_Async')) $myGA = new Google_Analytics_Async; remove_action( 'wp_head', array( $myGA, 'tracking_code_output' ) ); global $current_user; wp_get_current_user(); if(current_user_can('administrator')) : foreach($GLOBALS['wp_filter']['wp_head'][10] as $key=>$value) { if(stristr($key, 'tracking_code_output')) unset ($GLOBALS['wp_filter']['wp_head'][10][$key]); } add_action('wp_head', 'Google_Analytics_Async_Removed_Notice'); //remove_all_actions('wp_head'); endif; function Google_Analytics_Async_Removed_Notice(){ echo ''.PHP_EOL;}
© Copyright 2024 Sethmatics Websites All Rights Reserved.