Last active
September 30, 2015 20:07
-
-
Save atwellpub/143c40216ad286843d6a to your computer and use it in GitHub Desktop.
examples for preventing impression and conversion tracking
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 //remove me | |
add_action('wp_enqueue_scripts' , 'custom_inbound_prevent_tracking'); | |
function custom_inbound_prevent_tracking() { | |
wp_register_script('stop-inbound-stats-js', LANDINGPAGES_URLPATH . 'assets/js/stop_page_stats.js'); | |
/* disable tracking if administrtor */ | |
if (current_user_can('activate_plugins')) { | |
wp_enqueue_script('stop-inbound-stats-js'); | |
} | |
/* disable tracking by ip */ | |
if( $_SERVER['REMOTE_ADDR'] == '1.1.1.1.1') { | |
wp_enqueue_script('stop-inbound-stats-js'); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment