woocommerce_tracks_event_properties

woocommerce_tracks_event_properties

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.8.8.3

apply_filters('woocommerce_tracks_event_properties') is found 2 times:

  • /includes/tracks/class-wc-site-tracking.php line 78
    		 * Add global tracks event properties.
    		 *
    		 * @since 6.5.0
    		 */
    		$filtered_properties = apply_filters( 'woocommerce_tracks_event_properties', $client_tracking_properties, false );
    		$environment_type    = function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : 'production';
    		?>
    		<!-- WooCommerce Tracks -->
    		<script type="text/javascript">
    			window.wcTracks = window.wcTracks || {};
    			window.wcTracks.isEnabled = <?php echo self::is_tracking_enabled() ? 'true' : 'false'; ?>;
    
  • /includes/tracks/class-wc-tracks.php line 116
    		 * Allow event props to be filtered to enable adding site-wide props.
    		 *
    		 * @since 4.1.0
    		 */
    		$properties = apply_filters( 'woocommerce_tracks_event_properties', $event_properties, $event_name );
    		$user       = wp_get_current_user();
    		$identity   = WC_Tracks_Client::get_identity( $user->ID );
    
    		// Delete _ui and _ut protected properties.
    		unset( $properties['_ui'] );
    		unset( $properties['_ut'] );
    

See this hook used in plugins: