Makeup
BAUME ESSENTIEL Multi-Use Glow Stick Ref. 169060
LA BASE MASCARA Volume and Care Lash Primer Ref. 190250
31 LE ROUGE Satin Lipstick Ref. 171512
NOIR ALLURE Mascara Ref. 190010
LES BEIGES Healthy Glow Foundation Hydration and Longwear Ref. 184724
ROUGE ALLURE LAQUE Ultrawear Shine Liquid Lip Colour Ref. 165092
1 of /3
1 of /2
1 of /2
LES BEIGES HEALTHY GLOW FOUNDATION HYDRATION AND LONGWEARThe liquid foundation, featuring a hydrating formula and a seamless finish, evens the appearance of the complexion, for a radiant and natural-looking healthy glow. Find my shade
LIMITED EDITION LES BEIGES GOLDEN HOUR COLLECTIONWith colors ranging from iridescent bronze to vermilion red, the creations in this collection form a makeup ritual inspired by the last glimmers of light at sunset. Discover
ROUGE COCO BAUME SHINEThe tinted lip balm that’s as desirable as a lipstick has been reimagined, offering a finish with amplified brilliance.Shop now
the virtual makeover chanel try onget started
CHANEL now presents each purchase in recyclable, reusable packaging.
LE QUART D'HEURE ICONIQUE
Learn how to create the iconic CHANEL makeup look during this complimentary personalized 15-minute service.
${title}
${description}
Ref. ${sku} ${ copy.shade ? `
${copy.shade}
` : `
` }
${price}
${ hasVTO && copy.vto ? `
` : `
` }
`; $(this).replaceWith(carouselElement); console.log(Math.min(recs.length, arrayLength), i + 1); if (arrayLength == i + 1) { $(carouselContainer).css("opacity", "1"); showCarousels(); } } else if (recs.length > 0 && !recs[i]) { $(this).remove(); if (arrayLength == i + 1) { $(carouselContainer).css("opacity", "1"); showCarousels(); } } else { showCarousels(); } }); if (recs.length > 0) { if (variant.includes("Bestsellers")) { $(caruselTitle).text(`${commpleteInfo.component} Bestsellers`); } if (variant.includes("Essentials")) { $(caruselTitle).text(`${commpleteInfo.component} Essentials`); } if (variant.includes("Recommended")) { $(caruselTitle).text("Recommended for you"); } if (variant.includes("Holiday")) { $(caruselTitle).text("GIFTS SELECTED FOR YOU"); } if (variant.includes("Fday")) { $(caruselTitle).text("Father's Day Gifts"); } if (variant.includes("Vday")) { $(caruselTitle).text("GIFTS SELECTED FOR YOU"); } GATracking(commpleteInfo); fixPager(carousel, Math.min(recs.length, arrayLength)); getFavedProducts(); setTimeout(() => { $("#_xo30tiabo_main ul li").each((i, e) => { $(e).on("click", function (event) { GAClickTracking(commpleteInfo); let clickedSku = $(e).attr("data-sku"); taggingRecClicks(productTokens[clickedSku]); }); }); }, 1000); } } }, 500); } catch (error) { console.log(error); setTimeout(() => { showCarousels(); }, 2000); showCarousels(); } } function GATracking(carouselInfo) { let category = carouselInfo.component; let session = sessionStorage.getItem(`recommendedCarousel${category}`); if (session !== "active") { dataLayer.push({ event: "nievent", eventCategory: "monetate", eventAction: carouselInfo.impressionReporting[0].experience_name, eventLabel: carouselInfo.impressionReporting[0].variant_label, }); sessionStorage.setItem(`recommendedCarousel${category}`, "active"); } } function GAClickTracking(carouselInfo) { dataLayer.push({ event: "nievent", eventCategory: "Monetate", eventAction: carouselInfo.impressionReporting[0].experience_name, eventLabel: "click_" + carouselInfo.impressionReporting[0].variant_label.split("-")[1], }); } try { if (monetateIdCookie.length > 0) { myBody = { channel: "a-34c0f8bb/p/chanel.com", monetateId: monetateIdCookie, events: [ { eventType: "monetate:decision:DecisionRequest", requestId: "RecommendationsCarousels", includeReporting: true, }, { eventType: "monetate:context:PageView", url: "https://www.chanel.com/us/makeup/", pageType: "category_homepage", }, ], }; getAllRecommendedProducts(); } else { let times = 0; var timer = setInterval(function () { monetateIdCookie = document.cookie.replace( /(?:(?:^|.*;\s*)mt.v\s*\=\s*([^;]*).*$)|^.*$/, "$1" ); if (times == 5) { showCarousels(); clearInterval(timer); if (monetateIdCookie.length == 0) { dataLayer.push({ event: "error", eventCategory: "APIerror", eventAction: "EngineAPI", errorDescription: "No monetate cookie", }); } } if (monetateIdCookie.length > 0) { myBody = { channel: "a-34c0f8bb/p/chanel.com", monetateId: monetateIdCookie, events: [ { eventType: "monetate:decision:DecisionRequest", requestId: "RecommendationsCarousels", includeReporting: true, }, { eventType: "monetate:context:PageView", url: "https://www.chanel.com/us/makeup/", pageType: "category_homepage", }, ], }; getAllRecommendedProducts(); clearInterval(timer); } }, 200); } } catch (error) { console.log(error.message); showCarousels(); dataLayer.push({ event: "error", eventCategory: "APIerror", eventAction: "EngineAPI", errorDescription: error.message, }); setTimeout(() => { showCarousels(); }, 2000); }});$(document).ready(() => { let recommendedMakeup = []; let carouselContainer = "section #_ctfgk5afy"; let makeupCarousel = "#_xo30tiabo_main ul"; let monetateIdCookie = document.cookie.replace( /(?:(?:^|.*;\s*)mt.v\s*\=\s*([^;]*).*$)|^.*$/, "$1" ); let productTokens = {}; console.log($(makeupCarousel)); let myBody = { channel: "a-34c0f8bb/p/chanel.com", monetateId: monetateIdCookie, events: [ { eventType: "monetate:decision:DecisionRequest", requestId: "RecommendationsCarousels", includeReporting: true, }, { eventType: "monetate:context:PageView", url: "https://www.chanel.com/us/makeup/", pageType: "category_homepage", }, ], }; setTimeout(() => { showCarousels(); }, 1000); function showCarousels() { $(carouselContainer).css("opacity", "1"); } async function taggingProductsRec(items) { let arrayProducts = []; $(items).each((i, v) => { arrayProducts.push(v.recToken); productTokens[v.id] = v.recToken; }); let recImpressionsBody = { channel: "a-34c0f8bb/p/chanel.com", monetateId: monetateIdCookie, events: [ { eventType: "monetate:record:RecImpressions", recImpressions: arrayProducts, }, ], }; let headers = { "Content-Type": "application/json", }; const blob = new Blob([JSON.stringify(recImpressionsBody)], headers); try { navigator.sendBeacon("https://engine.monetate.net/api/engine/v1/decide/chanel", blob); } catch (error) { console.log(error); dataLayer.push({ event: "error", eventCategory: "APIerror", eventAction: "EngineAPI", errorDescription: error.message, }); } } async function taggingRecClicks(token) { let recClickBody = { channel: "a-34c0f8bb/p/chanel.com", monetateId: monetateIdCookie, events: [ { eventType: "monetate:record:RecClicks", recClicks: [token], }, { eventType: "monetate:record:PageEvents", pageEvents: [ "FNBRecsClicks" ] } ], }; let headers = { "Content-Type": "application/json", }; const blob = new Blob([JSON.stringify(recClickBody)], headers); try { navigator.sendBeacon("https://engine.monetate.net/api/engine/v1/decide/chanel", blob); } catch (error) { console.log(error); dataLayer.push({ event: "error", eventCategory: "APIerror", eventAction: "EngineAPI", errorDescription: error.message, }); document.cookie = `TaggingRecClicksError= event: "error",eventCategory: "APIerror",eventAction: "EngineAPI",errorDescription: ${error.message};`; } } async function getAllRecommendedProducts() { try { const response = await fetch("https://engine.monetate.net/api/engine/v1/decide/chanel", { method: "POST", body: JSON.stringify(myBody), // string or object headers: { "Content-Type": "application/json", }, }); myJson = await response.json(); //extract JSON from the http response if (myJson.data.responses[0].actions.length >= 1) { if (myJson.data.responses[0].actions.find((x) => x.component === "Makeup")) { let commpleteInfo = myJson.data.responses[0].actions.find( (x) => x.component === "Makeup" ); recommendedMakeup = myJson.data.responses[0].actions.find( (x) => x.component === "Makeup" ).items; replaceProducts(makeupCarousel, recommendedMakeup, commpleteInfo, true, true); taggingProductsRec(recommendedMakeup); } else { showCarousels(); } } else { dataLayer.push({ event: "error", eventCategory: "APIerror", eventAction: "EngineAPI", errorDescription: "No data retreived from the API", }); showCarousels(); } } catch (error) { console.log(error); dataLayer.push({ event: "error", eventCategory: "APIerror", eventAction: "EngineAPI", errorDescription: error.message, }); setTimeout(() => { showCarousels(); }, 2000); showCarousels(); } } async function getProductData(sku) { try { const response = await fetch( `https://www.chanel.com/us/yapi/product/${sku}?options=basic,stock,vto,shade&site=chanel` ); myJson = await response.json(); let copy = { title: myJson.basic.defaultName, description: myJson.basic.description, vto: myJson.vto.vtoEnabled, stock: myJson.stock.stockLevel, shade: myJson.shadeInfo.fullShadeName, }; return copy; } catch (error) { console.log(error); showCarousels(); } } async function getFavedProducts() { try { const response = await fetch(`https://www.chanel.com/us/yapi/pageload/`); myJson = await response.json(); let copy = myJson.PAGELOAD_WISHLIST.entries; for (let i = 0; i < copy.length; i++) { if ($(`button[data-wishlist="${copy[i].code}"]`)) { $(`button[data-wishlist="${copy[i].code}"]`).addClass("is-active"); } } } catch (error) { console.log(error); } } function fixPager(carousel, productQuantity) { let pageContainer = $(carousel).closest("div#_xo30tiabo_main").find("p.Pagination_root__ik5i6"); let lastPage = $(pageContainer).find("span:last-child"); let prevButton = $(pageContainer).next(".Arrows_nav__ueitz").find("button.Arrows_prev__ueitz"); let nextButton = $(pageContainer).next(".Arrows_nav__ueitz").find("button.Arrows_next__ueitz"); let totalPagesDesktop = productQuantity / 3; let totalPagesMobile = productQuantity / 2; let finalPage; let currrentPage; $(pageContainer) .find("span:first-child") .each(function () { if ($(this).is(":visible")) { currrentPage = +$(this).text(); } }); if (window.innerWidth > 600) { if (!Number.isInteger(totalPagesDesktop)) { finalPage = (Math.floor(totalPagesDesktop) + 1).toString(); } else { finalPage = totalPagesDesktop; } $(lastPage).text(finalPage); } else { if (!Number.isInteger(totalPagesMobile)) { finalPage = (Math.floor(totalPagesMobile) + 1).toString(); } else { finalPage = totalPagesMobile; } $(lastPage).text(finalPage); } if (currrentPage == finalPage) { $(nextButton).attr("hidden", true); $(nextButton).attr("aria-disabled", true); $(nextButton).hide(); } $(nextButton).click(() => { $(pageContainer) .find("span:first-child") .each(function () { if ($(this).is(":visible")) { currrentPage = +$(this).text() + 1; } }); if (currrentPage == finalPage) { $(nextButton).attr("hidden", true); $(nextButton).attr("aria-disabled", true); $(nextButton).hide(); } }); $(prevButton).click(() => { $(pageContainer) .find("span:first-child") .each(function () { if ($(this).is(":visible")) { currrentPage = +$(this).text() + 1; } }); if (currrentPage !== finalPage) { $(nextButton).attr("hidden", false); $(nextButton).attr("aria-disabled", false); $(nextButton).show(); } }); } async function checkAvailability(productsRecommendation) { let recs = []; if (productsRecommendation.length > 0) { $(productsRecommendation).each(async function (i) { let url = productsRecommendation[i].link; var parts = url.split("/"); let sku = parts[6]; let copy = await getProductData(sku); let stock = copy.stock; productsRecommendation[i].stock = stock; if (stock !== "OUT_STOCK") { recs.push(productsRecommendation[i]); } }); } return recs; } async function replaceProducts( carousel, productsRecommendation, commpleteInfo, hasDescription, hasVTO ) { try { let carouselProducts = $(carousel).find("li"); let arrayLength = carouselProducts.length; let variant = commpleteInfo.impressionReporting[0].variant_label; let caruselTitle = $(carousel).closest("section").find("div h2 span"); console.log("variant", variant); let recs = await checkAvailability(productsRecommendation); let availabilityCheckedTimes = 0; var check = setInterval(function () { availabilityCheckedTimes = ++availabilityCheckedTimes; if (availabilityCheckedTimes === 9 || recs.length >= 8) { recs.sort(function (a, b) { return b._affinity - a._affinity; }); console.log(variant); clearInterval(check); $(carouselProducts).each(async function (i) { if (recs.length > 0 && recs[i]) { let img = recs[i].imageLink; let price = "$" + recs[i].price; let url = recs[i].link; var parts = url.split("/"); let sku = parts[6]; let copy = await getProductData(sku); let title = copy.title; let description = copy.description; console.log(img, price, title, description); let carouselElement = `
${title} ${description} Ref. ${sku}
${ copy.shade ? `
${copy.shade}
` : `
` }
${price}
${ hasVTO && copy.vto ? `
` : `
` }
`; $(this).replaceWith(carouselElement); console.log(Math.min(recs.length, arrayLength), i + 1); if (arrayLength == i + 1) { $(carouselContainer).css("opacity", "1"); showCarousels(); } } else if (recs.length > 0 && !recs[i]) { $(this).remove(); if (arrayLength == i + 1) { $(carouselContainer).css("opacity", "1"); showCarousels(); } } else { showCarousels(); } }); if (recs.length > 0) { if (variant.includes("Bestsellers")) { $(caruselTitle).text(`${commpleteInfo.component} Bestsellers`); } if (variant.includes("Essentials")) { $(caruselTitle).text(`${commpleteInfo.component} Essentials`); } if (variant.includes("Recommended")) { $(caruselTitle).text("Recommended for you"); } if (variant.includes("Holiday")) { $(caruselTitle).text("GIFTS SELECTED FOR YOU"); } if (variant.includes("Fday")) { $(caruselTitle).text("Father's Day Gifts"); } if (variant.includes("Vday")) { $(caruselTitle).text("GIFTS SELECTED FOR YOU"); } GATracking(commpleteInfo); fixPager(carousel, Math.min(recs.length, arrayLength)); getFavedProducts(); setTimeout(() => { $("#_xo30tiabo_main ul li").each((i, e) => { $(e).on("click", function (event) { GAClickTracking(commpleteInfo); let clickedSku = $(e).attr("data-sku"); taggingRecClicks(productTokens[clickedSku]); }); }); }, 1000); } } }, 500); } catch (error) { console.log(error); setTimeout(() => { showCarousels(); }, 2000); showCarousels(); } } function GATracking(carouselInfo) { let category = carouselInfo.component; let session = sessionStorage.getItem(`recommendedCarousel${category}`); if (session !== "active") { dataLayer.push({ event: "nievent", eventCategory: "monetate", eventAction: carouselInfo.impressionReporting[0].experience_name, eventLabel: carouselInfo.impressionReporting[0].variant_label, }); sessionStorage.setItem(`recommendedCarousel${category}`, "active"); } } function GAClickTracking(carouselInfo) { dataLayer.push({ event: "nievent", eventCategory: "Monetate", eventAction: carouselInfo.impressionReporting[0].experience_name, eventLabel: "click_" + carouselInfo.impressionReporting[0].variant_label.split("-")[1], }); } try { if (monetateIdCookie.length > 0) { myBody = { channel: "a-34c0f8bb/p/chanel.com", monetateId: monetateIdCookie, events: [ { eventType: "monetate:decision:DecisionRequest", requestId: "RecommendationsCarousels", includeReporting: true, }, { eventType: "monetate:context:PageView", url: "https://www.chanel.com/us/makeup/", pageType: "category_homepage", }, ], }; getAllRecommendedProducts(); } else { let times = 0; var timer = setInterval(function () { monetateIdCookie = document.cookie.replace( /(?:(?:^|.*;\s*)mt.v\s*\=\s*([^;]*).*$)|^.*$/, "$1" ); if (times == 5) { showCarousels(); clearInterval(timer); if (monetateIdCookie.length == 0) { dataLayer.push({ event: "error", eventCategory: "APIerror", eventAction: "EngineAPI", errorDescription: "No monetate cookie", }); } } if (monetateIdCookie.length > 0) { myBody = { channel: "a-34c0f8bb/p/chanel.com", monetateId: monetateIdCookie, events: [ { eventType: "monetate:decision:DecisionRequest", requestId: "RecommendationsCarousels", includeReporting: true, }, { eventType: "monetate:context:PageView", url: "https://www.chanel.com/us/makeup/", pageType: "category_homepage", }, ], }; getAllRecommendedProducts(); clearInterval(timer); } }, 200); } } catch (error) { console.log(error.message); showCarousels(); dataLayer.push({ event: "error", eventCategory: "APIerror", eventAction: "EngineAPI", errorDescription: error.message, }); setTimeout(() => { showCarousels(); }, 2000); }});