This document outlines how to disable purchase event tracking for a specific user role in FunnelKit. You can achieve this by using a custom code snippet.
This guide will walk you through the steps to implement the snippet either through your child theme's functions.php file or by using the Code Snippets plugin.
Steps to Disable Purchase Event Tracking For Specific User Roles
Step 1: Access the Custom Code Snippet
To disable event tracking for a specific user role, use the following code snippet:
class BWF_Funnel_Temp_150320222 {
public function __construct() {
add_filter( 'wfocu_front_ecomm_tracking', [ $this, 'wffn_check' ] );
add_filter( 'wfacp_do_tracking', [ $this, 'wffn_check' ] );
add_filter( 'wfacp_css_js_deque', [ $this, 'wffn_check' ], 10 );
add_filter( 'wffn_allow_tracking', [ $this, 'wffn_check' ], 1, 10 );
add_filter( 'wffn_allow_site_wide_tracking', [ $this, 'wffn_check' ], 1, 10 );
}
function wffn_check( $should_render ) {
if ( current_user_can( 'administrator' ) || current_user_can( 'shop_manager' ) || current_user_can( 'editor' ) ) {
$should_render = false;
}
return $should_render;
}
}
new BWF_Funnel_Temp_150320222();
Step 2: Add the code snippet
You can add the snippet directly to your theme’s functions.php file. Alternatively, you can use the Code Snippets plugin for easier code management.
Step 3: Define User Role in the Snippet
In the code snippet, you can specify the user role for which you do not wish to track events.

Step 4: Add the Code to Your Site
After defining the user role, add the snippet either to your functions.php file or through the Code Snippets plugin to activate the changes.
Conclusion
By following these steps, you can disable purchase event tracking for specific user roles in FunnelKit.