Created
April 6, 2020 16:39
-
-
Save chriscct7/98aa70dc7832f36575ea7a739209b436 to your computer and use it in GitHub Desktop.
MonsterInsights Disable Frontend Tracking Disable Frontend Tracking for all users.
This file contains hidden or 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 | |
/** | |
* Plugin Name: MonsterInsights Disable Frontend Tracking | |
* Description: Disable Frontend Tracking for all users. | |
* Version: 1.0.0 | |
* Author: MonsterInsights Support Team | |
* Author URI: https://www.monsterinsights.com | |
*/ | |
function monsterinsights_custom_disable_frontend_tracking() { | |
remove_action( 'wp_head', 'monsterinsights_tracking_script', 6 ); | |
remove_action( 'wp_footer', 'monsterinsights_scroll_tracking_output_after_script', 11 ); | |
} | |
add_action( 'wp_head', 'monsterinsights_custom_disable_frontend_tracking', 0 ); | |
function monsterinsights_custom_disable_events_tracking() { | |
remove_action( 'template_redirect', 'monsterinsights_events_tracking', 9 ); | |
} | |
add_action( 'template_redirect', 'monsterinsights_custom_disable_events_tracking', 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment