diff --git a/includes/tracks/class-wc-site-tracking.php b/includes/tracks/class-wc-site-tracking.php index 24618c6a71c..138b3aeb863 100644 --- a/includes/tracks/class-wc-site-tracking.php +++ b/includes/tracks/class-wc-site-tracking.php @@ -108,6 +108,7 @@ class WC_Site_Tracking { include_once WC_ABSPATH . 'includes/tracks/events/class-wc-products-tracking.php'; include_once WC_ABSPATH . 'includes/tracks/events/class-wc-orders-tracking.php'; include_once WC_ABSPATH . 'includes/tracks/events/class-wc-settings-tracking.php'; + include_once WC_ABSPATH . 'includes/tracks/events/class-wc-status-tracking.php'; $tracking_classes = array( 'WC_Admin_Setup_Wizard_Tracking', @@ -116,6 +117,7 @@ class WC_Site_Tracking { 'WC_Products_Tracking', 'WC_Orders_Tracking', 'WC_Settings_Tracking', + 'WC_Status_Tracking', ); foreach ( $tracking_classes as $tracking_class ) { diff --git a/includes/tracks/events/class-wc-status-tracking.php b/includes/tracks/events/class-wc-status-tracking.php new file mode 100644 index 00000000000..ce34a053470 --- /dev/null +++ b/includes/tracks/events/class-wc-status-tracking.php @@ -0,0 +1,48 @@ + $tab, + 'tool_used' => isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : null, + ) + ); + + if ( 'status' === $tab ) { + wc_enqueue_js( + " + $( 'a.debug-report' ).click( function() { + window.wcTracks.recordEvent( 'status_view_reports' ); + } ); + " + ); + } + } + } +}