Skip to main content

Example : Fixed Narrow

Logic

Add a fixed narrow (filter) to the page that can't be removed for every page with "Shirt" in the URL

JS Code:

function hooks() {
if(window.location.href.includes("shirt")){
window.SerpOptions.registerHook("serp-fixed-narrow", () => ({"Type": ["Shirt"],"Tag": ["sale"],"Price_from_to":["0-100"]}));
}
}

// execution here
if (window.SerpOptions) {
hooks();
} else {
window.addEventListener('fast-serp-ready', function () {
hooks();
});
}