facetwp select and refresh after loaded

<?php

function fwp_preload_facets() {
	?>
    <script>
        (function($) {
            $(document).on('facetwp-loaded', function() {
                if ( '' == FWP.build_query_string() && 'shop' == FWP_HTTP.uri) {
                    FWP.is_reset = true;
                    FWP.facets['product_categories'] = ['clothing'];
                    FWP.refresh();
                }
            });
        })(jQuery);
    </script>
	<?php
}
add_action( 'wp_head', 'fwp_preload_facets', 100 );