(function() { function bxBootstrap() { var re = /bot|crawl|slurp|spider|mediapartners|headlesschrome|snap-prefetch|remotasks|woorank|uptime\.com|facebookexternalhit|facebookcatalog/i; if (re.test(navigator.userAgent) || navigator.userAgent == '') { return; } if (!(window.bouncex&&bouncex.website)) { var pushedData = []; if(window.bouncex && bouncex.push && bouncex.length){ pushedData = bouncex; } window.bouncex = {}; bouncex.pushedData = pushedData; bouncex.website = {"id":3271,"name":"Stacy Adams","cookie_name":"bounceClientVisit3271","domain":"stacyadams.com","ct":"fp_local_storage","ally":1,"ei":0,"tcjs":"","cjs":"","force_https":false,"waypoints":false,"content_width":900,"gai":"UA-2008304-1","swids":"","sd":0,"ljq":"auto","campaign_id":0,"is_preview":false,"aco":{"first_party_limit":"10000","local_storage":"1"},"cmp":{"gdpr":0,"gmp":0,"whitelist_check":0},"burls":[],"ple":false,"fbe":true,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"var listPageTileLinkSelector = '#gridProduct div:has(\".sku\")',\n\tCOOKIE_NAME = 'customer';\n/* |----------- HELPER FUNCTIONS ----------------| */\nfunction trackItem() {\n\tvar id = getIdFromUrl(window.location.pathname);\n\tvar group_id = getgroupId();\n\tbouncex.push([\n\t\t'item',\n\t\t{\n\t\t\tid: id,\n\t\t\tcopy: bouncex.vars.prod_name,\n\t\t\tsubcopy: bouncex.vars.prod_name_bottom,\n\t\t\timageurl: bouncex.vars.imageurl,\n\t\t\tcategory: bouncex.vars.item_category,\n\t\t\turl: bouncex.utils.url.allowParams(),\n\t\t\tprice: bouncex.vars.prod_price,\n\t\t\tinstock: bouncex.vars.in_stock\n\t\t}\n\t]);\n\n\tbouncex.push(['view item', {\n\t\t'item:id': id,\n\t\t'item:itemgroupid': group_id\n\t}]);\n\n\t/*\tsku tracking for catalog modules */\n\tbouncex.et.setInterval(trackSelectSku(id));\n}\n\nfunction getgroupId() {\n\treturn jQuery('[id*=\"SkuCode\"]').length && jQuery('[id*=\"SkuCode\"]').text().split('-')[0] || null;\n}\n\nfunction trackSelectSku(itemId) {\n\treturn function () {\n\t\tvar sku = getSku();\n\t\tvar group_id = getgroupId();\n\n\t\tif (bouncex.vars.prev_sku !== Number(sku)) {\n\t\t\tif (sku) {\n\t\t\t\tbouncex.push([\n\t\t\t\t\t'select_sku',\n\t\t\t\t\t{\n\t\t\t\t\t\t'item:id': itemId,\n\t\t\t\t\t\t'item:itemgroupid': group_id,\n\t\t\t\t\t\t'item:feedid': sku\n\t\t\t\t\t}\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\tbouncex.setv('prev_sku', sku);\n\t\t}\n\t};\n}\n\nfunction getSku() {\n\treturn jQuery('#UPC').length && jQuery('#UPC').val() || null;\n}\n\nfunction getIdFromUrl(url) {\n\tvar match = url.match(/\\/([\\w-]+)\\.html/);\n\tif (match && match[1]) {\n\t\treturn match[1];\n\t}\n}\n\nfunction giftCard() {\n\treturn jQuery('head title').text().indexOf('Gift Card') > -1 || window.location.href.indexOf('netreo') > -1;\n}\n\nfunction isCategoryGrid() {\n\treturn jQuery(listPageTileLinkSelector).length > 0;\n}\n\nfunction trackCategory() {\n\tbouncex.push(['view category', {\n\t\t'items:ids': getAllItemIdsOnListpage(),\n\t\t'page:url': bouncex.utils.url.allowParams(),\n\t\t'page:title': bouncex.vars.page_title,\n\t}]);\n}\n\nfunction getAllItemIdsOnListpage() {\n\tvar items = jQuery(listPageTileLinkSelector);\n\tvar itemIds = [];\n\tfor (var i = 0; i < items.length; i++) {\n\t\tvar id = getItemIdOnListpage(items.eq(i));\n\t\tif (id && itemIds.indexOf(id) === -1) {\n\t\t\titemIds.push(id);\n\t\t}\n\t}\n\treturn itemIds.join(',');\n}\n\nfunction getItemIdOnListpage(el) {\n\treturn getIdFromUrl(el.find('a').attr('href'));\n}\n\nfunction trackProductPageATC() {\n\tvar cookie;\n\tbouncex.et.onTrue(function() {\n\t\tcookie = bouncex.getBounceCookie(COOKIE_NAME);\n\t\treturn cookie;\n\t}, function() {\n\t\tvar id = getIdFromUrl(window.location.pathname);\n\t\tbouncex.push(['add to cart', {\n\t\t\t'item:id': id,\n\t\t\t\"cart:token\": cookie\n\t\t}]);\n\t\tbouncex.setBounceCookie();\n\t}, 5);\n}\n\nfunction stylePage() {\n\treturn window.location.pathname.indexOf('shop/style.html') > -1;\n}\n\nfunction trackStylePage() {\n\tbouncex.push(['view category', {\n\t\t'items:ids': getAllItemIdsOnStylePage(),\n\t\t'page:url': bouncex.utils.url.allowParams(),\n\t\t'page:title': 'Stacy Adams Style',\n\t}]);\n}\n\nfunction getAllItemIdsOnStylePage() {\n\tvar items = jQuery('div[id*=popup]');\n\tvar itemIds = [];\n\tfor (var i = 0; i < items.length; i++) {\n\t\tvar id = getItemIdOnStylePage(items.eq(i));\n\t\tif (id && itemIds.indexOf(id) === -1) {\n\t\t\titemIds.push(id);\n\t\t}\n\t}\n\treturn itemIds.join(',');\n}\n\nfunction getItemIdOnStylePage(el) {\n\treturn getIdFromUrl(el.find('a[role=\"button\"]').attr('href'));\n}\n\nfunction trackStyleQuickView() {\n\tvar id = getIdFromUrl(jQuery('.instaPopup[style=\"display: block;\"]').find('#instaProduct a').attr('href'));\n\tbouncex.push(['view item', {\n\t\t'item:id': id\n\t}]);\n}\n\n/* |----------- EVENT TRACKING ----------------| */\nif (bouncex.vars.valid_domain) {\n\n\n\tif (bouncex.website.pts === 'product' && !giftCard()) {\n\t\ttrackItem();\n\t}\n\tif (bouncex.website.pts === 'category' && !giftCard() && isCategoryGrid()) {\n\t\ttrackCategory();\n\t}\n\n\t/* track add to cart from PDP */\n\tif (bouncex.website.pts === 'product') {\n\t\tbouncex.et.on(jQuery(document), 'click', trackProductPageATC, '[id=\"style:btnSkuIsAvailableMobile\"]');\n\t}\n\n\t/* track Quick View on Style page */\n\tif (stylePage()) {\n\t\ttrackStylePage();\n\t\tbouncex.et.onVisible('#stylePopup', trackStyleQuickView);\n\t}\n\n\t/* track empty cart */\n\tbouncex.et.onVarChange('cart_qty', function (oldVal, newVal) {\n\t\tif (oldVal && !newVal) {\n\t\t\tbouncex.push(['empty_cart']);\n\t\t}\n\t});\n\n}\n\n/* |----------- CART INIT AND REPLENISHMENT ----------------| */\nfunction replenish(cart) {\n bouncex.utils.cookies.create({ name: COOKIE_NAME, value: cart.token });\n window.location.href = window.location.pathname + \"?bx_replen=true\";\n}\n\nbouncex.et.cart.init({\n\tcartCountVariable: 'cart_qty',\n\tstoreValues: [],\n\treplenishmentType: 'cookie',\n\treplenish: replenish\n});\n\n","dge":true,"bxidLoadFirst":false,"pie":true,"cme":true,"gbi_enabled":0,"bpush":false,"pt":{"cart":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/shoppingCart"}]]},"category":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('#gridPage').length > 0;"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/styleGridSearch"}]]},"checkout":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/checkout"}]]},"home":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/index"}]]},"product":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('#detail-product').length > 0;"}]]},"search":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/styleGridSearch"}]]},"test":{"testmode":true,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":""}]]}},"els":{"CART - Checkout Button":"input.btn","CART - Promo Code Apply Button":"input.apply","CART - Promo Code Box":".input","CAT - Product Grid Image":".grid-image img","Footer":"#footer","Navigation bar":"#wrapper-header","PDP - Color Option":".shoe-swatches","PDP - Hero Image":"#shoe-image","PDP - Product Name":".detail-right .name","PDP - Product Price":".detail-right .price","PDP - Quantity Option":".quantity","PDP - Review Stars":".pr-snippet:eq(0)","PDP - Size Option":".size","PDP - Thumbnail Image":".gallery-thumbs","SEARCH - Product Grid Image":".grid-image img","skip_link":"a.sr-only"},"vars":[{"name":"logged_in","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('#main-nav a[href=\"/shop/customers/accountDetails.html\"]').length > 0;","trigger":""},{"name":"ever_logged_in","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in || null;","trigger":""},{"name":"cart_qty","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"0","code":"Number(jQuery('#style\\\\:cartBadge, #main\\\\:cartBadge, #checkout\\\\:cartBadge, #mainGrid\\\\:cartBadge').text());","trigger":""},{"name":"cart_value","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"0","code":"Number(jQuery('#dropCheckout .subtotal .amount').text().replace(/[^0-9.]/g, ''));","trigger":""},{"name":"submitted_onsite","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(jQuery('.email-suc:contains(\"You have been signed up\"):visible').length > 0 || jQuery('#main\\\\:lblOptinSuccessMessage:contains(\"You have been signed up\"):visible').length > 0 || jQuery('#main\\\\:lblOptinSuccessMessageFooter:contains(\"You have been signed up\"):visible').length > 0) || null;","trigger":""},{"name":"cart","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"prod_name","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'product' ? jQuery('#style\\\\:lblName,#style\\\\:lblNameSale').text().trim().toUpperCase() : false;","trigger":"pageload"},{"name":"prod_name_bottom","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'product' ? jQuery('#style\\\\:lblLongName,#style\\\\:lblLongNameSale').text().trim() : null;","trigger":"pageload"},{"name":"imageurl","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'product' ? jQuery('meta[property=\"og:image\"]').attr('content') : null;","trigger":"pageload"},{"name":"item_category","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'product' ? jQuery('input[id*=\"StyleCategory\"]').attr('value') : null;","trigger":"pageload"},{"name":"prod_price","polling":"none","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"(function(){var $salePrice = jQuery('.price.product .salePrice'); if ($salePrice.length > 0) {return Number($salePrice.text().replace(/[^0-9.]/g, ''));}return Number(jQuery('.price.product .price').text().replace(/[^0-9.]/g, ''));})();","trigger":"pageload"},{"name":"in_stock","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'product' && jQuery('#style\\\\:lblNotAvailable:visible').length === 0 ? true : false;","trigger":"pageload"},{"name":"prev_sku","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"page_title","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts === 'category' ? jQuery('.titleCategory2 h1').text().trim() : null;","trigger":"pageload"},{"name":"valid_domain","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"window.location.hostname === \"stacyadams.com\" || window.location.hostname === \"www.stacyadams.com\";","trigger":"pageload"}],"dgu":"pixel.cdnwidget.com","dgp":false,"ba":{"enabled":0,"fbte":0},"biu":"assets.bounceexchange.com","bau":"api.bounceexchange.com","beu":"events.bouncex.net","ibx":{"tjs":"","cjs":"","miw":1,"mibcx":1,"te":1,"cart_rep":{"get":"","set":""},"ulpj":{"bxid":"espemailid"},"cus":"","miw_exclude":"","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":0,"spatm":1,"preinit_cjs":"/** \n * Segments - Cartridge Boilerplate\n * This code belongs in pre-init.js. If you want to write code\n * that runs when the page loads but does not leverage the intercept\n * or mirror methods use the Event Tracking code block. Don't forget\n * to change testMode to false to set your code live.\n */\n\nvar segments = {\n /* PROPERTIES */\n testMode: true,\n interceptEnabled: true,\n mirrorEnabled: true,\n dlWatcherEnabled: false,\n /* METHODS */\n /* Intercept Events */\n useIntercept: function() {\n if (this.interceptEnabled) {\n bouncex.utils.shqInterceptEvent = {\n // true blocks event, defined functions run in place of default\n 'cartAdd': function() {\n var pid = bouncex.utils.getNestedProp('window.item.SKU', ''),\n price = bouncex.utils.getNestedProp('window.item.Price', '');\n if (pid && price) {\n _shq.push(['onCartAdd', {\n CartId: null,\n Items: [{\n ProductId: pid,\n Quantity: 1,\n UnitPrice: price\n }],\n Total: null\n }]);\n }\n }\n };\n }\n },\n /* Mirror Events */\n useMirror: function() {\n if (this.mirrorEnabled) {\n bouncex.utils.shqMirrorEvent = {\n // defined functions run after designated shq_wknd_event to process event or source names\n 'pageview': function() {\n var sp = bouncex.utils.getParam('text');\n if (bouncex.website.pts === 'search' && sp) {\n _shq.push(['pageView', {\n pageType: 'search',\n searchPhrase: sp\n }]);\n }\n }\n };\n }\n },\n dlFuncs: function(e) {\n // Write handle methods here:\n //PDP\n if (e.PageType && e.PageType === 'ProductPage') {\n //do PDP event\n }\n },\n useDLWatcher: function() {\n if (!!this.dlWatcherEnabled) {\n window.bouncex.et.onTrue(function() {\n return window.bouncex.utils.getNestedProp('window._shq.loaded') && !!window.dataLayer && !!bouncex.et.setInterval;\n }, function() {\n // instantiate DataLayerHandler Object\n var dlWatcher = new _shq.DataLayerHandler(window.dataLayer);\n // invoke watch method\n dlWatcher.watch(function(e) {\n segments.dlFuncs(e);\n }, {});\n });\n }\n },\n /* Initialize Segments Tracking */\n init: function() {\n // test mode\n if (this.testMode && !bouncex.testmode.bxdev) return;\n // attach object to window & bouncex.utils\n if (window.bouncex.utils) bouncex.utils.segments = this;\n\n // initialize intercept and mirror, comment out if not needed\n this.useIntercept();\n this.useMirror();\n }\n}\n\nsegments.init();\n\n//To use dlFuncs call this in Event Tracking\n//bouncex.utils.segments.useDLWatcher();","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"Hit 'Send' to sign-up for automated, recurring Stacy Adams mktg txts (like cart reminders) to this #, per terms.","eventSharing":true,"shqId":"axvb7sznoc-1","enabled":1},"pde":true,"fmc":["US","CA"],"fme":true,"fmx":"","sdk":{"android":{"enabled":false,"enabledVersions":[],"eventModifications":null},"ios":{"enabled":false,"enabledVersions":[],"eventModifications":null}},"onsite":{"enabled":1},"ads":{"enabled":0},"pubs":{"enabled":0},"websdk":{"enabled":0},"ga4_property_id":"320133652","ga4_measurement_id":"G-EMZCVXJE9X","tag_state_domain":"api.bounceexchange.com"} ; bouncex.tag = 'tag3'; bouncex.$ = window.jQuery; bouncex.env = 'production'; bouncex.restrictedTlds = {"casl":{"ca":1},"gdpr":{"ad":1,"al":1,"at":1,"ax":1,"ba":1,"be":1,"bg":1,"by":1,"xn--90ais":1,"ch":1,"cy":1,"cz":1,"de":1,"dk":1,"ee":1,"es":1,"eu":1,"fi":1,"fo":1,"fr":1,"uk":1,"gb":1,"gg":1,"gi":1,"gr":1,"hr":1,"hu":1,"ie":1,"im":1,"is":1,"it":1,"je":1,"li":1,"lt":1,"lu":1,"lv":1,"mc":1,"md":1,"me":1,"mk":1,"xn--d1al":1,"mt":1,"nl":1,"no":1,"pl":1,"pt":1,"ro":1,"rs":1,"xn--90a3ac":1,"ru":1,"su":1,"xn--p1ai":1,"se":1,"si":1,"sj":1,"sk":1,"sm":1,"ua":1,"xn--j1amh":1,"va":1,"tr":1}}; bouncex.client = { supportsBrotli: 1 }; bouncex.assets = {"ads":"005ab6b05ecd8ae76686b26c919990d4","creativesBaseStyles":"a53944a2","gpsAuction":"bbb80866120d17013073bb6d284cbd6b","inbox":"75060a85c1a4aebcc6f779b9e84db722","onsite":"abbdf7a49be9b52b097917b7b527b262","sms":"e39203556bab2366e56296ce42e974a7","websdk":"3cdb3cd0b71927a211b8afdc85918cfd"}; bouncex.push = function(pushData) { bouncex.pushedData.push(pushData); } var runtime = document.createElement('script'); runtime.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/runtime_6459738026535cda4232dc813c61447d.br.js'); runtime.setAttribute('async', 'async'); runtime.setAttribute('onload', 'bouncex.initializeTag()'); bouncex.initializeTag = function() { var script = document.createElement('script'); script.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/main-v2_756cfb1d158076d67943a971b41e5c68.br.js'); script.setAttribute('async', 'async'); document.body.appendChild(script); var deviceGraphScript = document.createElement('script'); deviceGraphScript.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/cjs_min_3a843477d8e318f67237a66d0a58c542.js'); deviceGraphScript.setAttribute('async', 'async'); var dgAttrs = [{"Key":"id","Value":"c.js"},{"Key":"async","Value":"true"},{"Key":"data-apikey","Value":"2^HIykD"},{"Key":"data-cb","Value":"bouncex.dg.initPostDeviceGraph"},{"Key":"data-bx","Value":"1"},{"Key":"data-gm","Value":"1"},{"Key":"data-fire","Value":"1"}]; if (dgAttrs) { for (var i = 0; i < dgAttrs.length; i++) { deviceGraphScript.setAttribute(dgAttrs[i].Key, dgAttrs[i].Value); } } document.body.appendChild(deviceGraphScript); bouncex.initializeTag = function() {}; }; document.body.appendChild(runtime); } window._shq = window._shq || []; var eventSharingCartridge = document.createElement('script'); eventSharingCartridge.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/wknd_audiences_2648fa8509e4b3a98a2790bb8171ddc1.js'); eventSharingCartridge.setAttribute('async', 'async'); document.body.appendChild(eventSharingCartridge); } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", bxBootstrap); } else { bxBootstrap(); }})();