Skip to content

Instantly share code, notes, and snippets.

@atwellpub
Last active September 30, 2015 20:07
Show Gist options
  • Save atwellpub/143c40216ad286843d6a to your computer and use it in GitHub Desktop.
Save atwellpub/143c40216ad286843d6a to your computer and use it in GitHub Desktop.
examples for preventing impression and conversion tracking
<?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