Created
July 25, 2016 18:22
-
-
Save danieliser/889701698a67daf9271dee529dec54f1 to your computer and use it in GitHub Desktop.
Disable tracking of Super Admins & Admins with WPMUDev Google Analytics+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Disable Analytics for Admins. | |
add_action( 'init', function () { | |
global $google_analytics_async; | |
if ( is_super_admin() || current_user_can( 'administrator' ) ) { | |
remove_action( 'wp_head', array( $google_analytics_async, 'tracking_code_output' ) ); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment