hm.waitUntil(function() { return hm.version; }).then(function() { hm.cookies = hm.cookies || new hm.Cookies(); var nuanceData={}; window.nuanceData = nuanceData; if(hm.cookies && hm.cookies.readCookie('userCookie')){ var userCookieVal = JSON.parse(hm.cookies.readCookie('userCookie')); if (userCookieVal){ if(userCookieVal.cartCount>=0){ nuanceData["cartCount"] = userCookieVal.cartCount; } if(userCookieVal.dominantCategory){ nuanceData["dominantCategory"] = userCookieVal.dominantCategory; } if(userCookieVal.cartProducts){ nuanceData["cartProducts"] = userCookieVal.cartProducts; } if(userCookieVal.hybris_firstName){ nuanceData["hybris_firstName"] = decodeURIComponent((userCookieVal.hybris_firstName + '').replace(/\+/g, '%20')); } if(userCookieVal.hybris_uuid){ nuanceData["hybris_uuid"] = userCookieVal.hybris_uuid; } if(userCookieVal.customer_id){ nuanceData["customer_id"] = userCookieVal.customer_id; } if(userCookieVal.type){ nuanceData["type"] = userCookieVal.type; } if(userCookieVal.str){ nuanceData["st"] = decodeURIComponent(userCookieVal.str.replaceAll(/\+/g, ' ')); } if(userCookieVal.zc){ var val = userCookieVal.zc.replace(/[+,-]/g," "); nuanceData["zc"] = val; } if(userCookieVal.tn){ nuanceData["tn"] = decodeURIComponent(userCookieVal.tn.replaceAll(/\+/g, ' ')); } } } var favouritesCookie = hm.options.product.country + "-favourites"; var hasFav = hm.cookies.readCookie("hm-austria-favourites"); if(hasFav && !(hasFav==="\"\"")){nuanceData["hm-country-favourites"] = hasFav;} console.log(nuanceData); });