var dataLayer = window["dataLayer"] || []; if (!window.wsf) { window.wsf = { AnalyticsVariables: {} }; } window.wsf.AnalyticsVariables = {"event_name":"internal search","eventCategory":"internal search","search_keyword":null,"eventAction":"search::manual","eventLabel":null,"method":"manual"}; var initData = dataLayer[0]; if (initData !== undefined) { dataLayer[0] = Object.assign({}, initData, window.wsf.AnalyticsVariables); } else { dataLayer.push(window.wsf.AnalyticsVariables); }

Results

var dataLayer = window["dataLayer"] || []; if (!window.wsf) { window.wsf = { AnalyticsVariables: {} }; } window.wsf.AnalyticsVariables = {"numberResults":10}; var initData = dataLayer[0]; if (initData !== undefined) { if (initData["numberResults"] !== undefined) { window.wsf.AnalyticsVariables["numberResults"] = +initData["numberResults"] + 10; } dataLayer[0] = Object.assign({}, initData, window.wsf.AnalyticsVariables); } else { dataLayer.push(window.wsf.AnalyticsVariables); } { "@context": "http://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type":"ListItem", "position": 1, "item": { "@id": "/", "name": "Home" } } , { "@type":"ListItem", "position": 2, "item": { "@id": "https://www.lorealparis.ca/en-ca/search-page", "name": "Search Page" } } , { "@type":"ListItem", "position": 3, "item": { "@id": "https://www.lorealparis.ca/en-ca/search-page/product-results", "name": "Product Results" } } ] }