(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":5577,"name":"Boden USA ","cookie_name":"bounceClientVisit5577","domain":"bodenusa.com","ct":"bind_to_domain","ally":0,"ei":0,"tcjs":"","cjs":"let segments = {\n /* PROPERTIES */\n testMode: false,\n interceptEnabled: true,\n mirrorEnabled: true,\n arrayObserverEnabled: true,\n /* METHODS */\n /* Intercept Events */\n useIntercept: function() {\n if (!this.interceptEnabled) {\n return;\n }\n bouncex.utils.shqInterceptEvent = {\n productView: true,\n cartAdd: true,\n categoryView: true,\n purchase: function(wkndEventParams){\n var prodErr = false;\n var orderId = bouncex.utils.getNestedProp('obj.order_id', null, wkndEventParams);\n var purchTotal = Number(bouncex.utils.getNestedProp('obj.amount', 0, wkndEventParams)) - ( Number(bouncex.utils.getNestedProp('obj.tax', 0, wkndEventParams)) + Number(bouncex.utils.getNestedProp('obj.shipping', 0, wkndEventParams)) );\n var orderInfo = bouncex.utils.getNestedProp('obj.item', null, wkndEventParams);\n var orderArray = orderInfo && orderInfo.map(function (ea) {\n return { productId: ea.sku, price: Number(ea.price), qty: ea.quantity };\n });\n\n if (orderArray.length < 1) {\n prodErr = true;\n }\n if (!prodErr && orderId){\n var lineItems = bouncex.utils.getNestedProp('Shopify.checkout.line_items',[]),\n subscriptions = lineItems.reduce(function (x, i) {\n var subFlag = false;\n if (i.selling_plan_id && i.selling_plan_name) {\n subFlag = true;\n }\n x.push({ is_subscription: subFlag, productId_scraped: i.variant_id,purchase_product_id:i.variant_id });\n return x;\n }, []);\n if (subscriptions.length > 0) {\n subscriptions.forEach(function (item) {\n _shq.push(['onCustomProduct', item]);\n });\n }\n _shq.push(['onPurchase',\n {\n 'orderItems' : orderArray,\n 'orderId': orderId,\n 'total': purchTotal.toFixed(2)\n }]);\n }else{\n _shq.push(['onPurchase',\n {\n 'orderId' : orderId || 'NoOrderId-' + randomNumber(),\n 'usebasket': true\n }]);\n }\n }\n };\n },\n useMirror:function() {\n if (!this.mirrorEnabled) {\n return;\n }\n bouncex.utils.shqMirrorEvent = {\n // defined functions run after designated shq_wknd_event to process event or source names\n 'reloadcampaigns': false,\n 'pageview': function() {\n var catCode='', oldCode = '', catDone = false;\n if(bouncex.website.pts === 'category'){\n bouncex.setInterval2(function(){\n catCode = bouncex.utils.getNestedProp('location.href').split('#').pop();\n if(catCode && catCode !== oldCode && !catDone){\n _shq.push(['onCategory',\n {\n 'catId': catCode,\n 'catName': catCode\n }]);\n oldCode = catCode;\n catDone = true;\n }else if(oldCode === catCode){\n catDone = false;\n }\n },500);\n }\n if (bouncex.website.pts === 'search'){\n var searchTerm = bouncex.utils.getParam('q').replace(/\\+/gi,' ');\n if (searchTerm){\n _shq.push([ 'onSearch',\n {\n 'searchPhrase': searchTerm\n }]);\n }\n }\n\n }\n };\n },\n capturePDP: function (){\n var prodID = bouncex.utils.getNestedProp('ShopifyAnalytics.meta.product.variants[0].id');\n if(prodID && bouncex.utils.getNestedProp('location.href').indexOf('/products/') > -1){\n _shq.push(['onProductView',\n {\n 'productId': prodID.toString()\n }]);\n }\n },\n captureATC: function(obj){\n var prodId = bouncex.utils.getNestedProp('variant_id','',obj);\n var price = bouncex.utils.getNestedProp('price',0,obj)/100;\n var qty = bouncex.utils.getNestedProp('quantity','',obj);\n var atcArray = [];\n\n if(prodId && qty && price){\n atcArray.push({\n 'ProductId': prodId.toString(),\n 'UnitPrice': price,\n 'Quantity': qty\n });\n if (atcArray){\n _shq.push(['onCartAdd', {'Items': atcArray }]);\n }\n }\n },\n captureCartview: function(obj){\n if (obj.items && obj.items.length > 0) {\n var Total = obj.items_subtotal_price/100 || 0,\n Items = obj.items.map(function (k){\n return {'UnitPrice': k.price/100, 'Quantity': k.quantity, 'ProductId': k.variant_id.toString()};\n });\n\n _shq.push(['onCartView',{\n Items,\n Total\n }]);\n }\n },\n cartAJAX: function(){\n bouncex.setTimeout2(function(){\n if(bouncex.website.pts === 'cart'){\n bouncex.et.on(bouncex.document, 'ajaxComplete', function (e, xhr, settings) {\n if(settings && settings.url.indexOf('/cart/add') > -1 ){\n segments.captureATC(xhr.responseJSON);\n }\n if (settings && settings.url.indexOf('/cart/change') > -1){\n segments.captureCartview(xhr.responseJSON);\n }\n });\n }\n }, 700);\n },\n customProductView: function(){\n var purl = window.location.href.indexOf('starter-kit-oxygen-boost') > -1;\n var pType = bouncex.utils.getNestedProp('ShopifyAnalytics.meta.page.pageType', null);\n var prodID = pType && pType === 'product' && bouncex.utils.getNestedProp('ShopifyAnalytics.meta.product.variants[0].id');\n if(purl && prodID){\n _shq.push(['onProductView', \n {\n 'pageType': 'product',\n 'productId': prodID.toString()\n }]);\n }\n },\n processObserver: function(e) {\n // Write handle methods here:\n while (e.length) {\n let event = e.shift();\n // event variable will contain the object to process.\n if(bouncex.utils.getNestedProp('event', '', event) === 'thrive_add_to_cart'){\n segments.captureATC(event.itemsArray);\n }\n }\n },\n arrayObserver: function() {\n if (!segments.arrayObserverEnabled) {\n return;\n }\n bouncex.et.onTrue(\n () => {\n return bouncex.utils.getNestedProp('window._shq.loaded');\n },\n () => {\n _shq.ArrayObserver(window.dataLayer, (e) => {\n segments.processObserver(e);\n }, {catchUp: true, filter: e=>e.event});\n }\n );\n },\n\n /* Initialize Segments Tracking */\n init: function() {\n // test mode\n if (segments.testMode && !bouncex.testmode.bxdev) return;\n // attach object to window & bouncex.utils\n if (!bouncex.utils) {\n return;\n }\n bouncex.utils.segments = this;\n // initialize intercept and mirror, comment out if not needed\n segments.useIntercept();\n segments.useMirror();\n segments.capturePDP();\n segments.arrayObserver();\n segments.cartAJAX();\n segments.customProductView();\n },\n};\n\nsegments.init();","force_https":false,"waypoints":false,"content_width":900,"gai":"","swids":"","sd":0,"ljq":"auto","campaign_id":0,"is_preview":false,"aco":{"first_party_limit":"3500","local_storage":"1"},"cmp":{"gdpr":0,"gmp":0,"whitelist_check":0},"burls":[],"ple":false,"fbe":true,"mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"/* ---------------------------- SHARED VARIABLES ---------------------------- */\n\nvar CLEAN_URL = bouncex.utils.url.allowParams(['q']),\n ATC_SELECTOR = 'button[class*=\"add-to-bag\"]';\n\n/* --------------------------------- HELPERS -------------------------------- */\n\nfunction getIdFromUrl(url) {\n var noParams = url ? bouncex.utils.url.allowParams([], url) : '';\n\n return noParams.split('/').pop();\n}\n\nfunction isValidItemId(id) {\n return (id || '').split('-').length > 2;\n}\n\nfunction getPrice() {\n var originalPrice = jQuery('.pdp-price-wrapper .product-price').last().text().replace(/[^0-9./]/g, ''),\n salePrice = jQuery('.updated-price-text').first().text().split(' ').shift().replace(/[^0-9./]/g, '');\n\n return salePrice || originalPrice;\n}\n\n/* ------------------------------ ITEM TRACKING ----------------------------- */\n\nfunction getItem() {\n return {\n id: bouncex.vars.item_id,\n copy: jQuery('.product-title__main').first().text(),\n category: jQuery('.breadcrumbs-list__item-link').last().text() || 'Global',\n url: CLEAN_URL,\n imageurl: jQuery('.image-gallery__thumbs-img-wrapper source').attr('srcset'),\n instock: jQuery(ATC_SELECTOR).text().toLowerCase().indexOf('add to bag') > -1,\n price: getPrice()\n };\n}\n\nfunction fireViewItem(id) {\n bouncex.push(['view item', { 'item:id': id }]);\n}\n\nfunction initializeItemEvents() {\n var item;\n\n bouncex.et.onTrue(\n function () {\n item = getItem();\n return !!item.copy &&\n !!item.category &&\n !!item.url &&\n !!item.imageurl &&\n isValidItemId(item.id);\n },\n function () {\n if (item.url.indexOf('gift-voucher') > -1) {\n return;\n }\n bouncex.push(['item', item]);\n fireViewItem(item.id);\n initializeATCClickTracking(item.id);\n trackStylitics(item.url);\n },\n 10\n );\n}\n\n/* ---------------------------- STYLITICS TRACKING --------------------------- */\n\nfunction trackStylitics(itemUrl) {\n jQuery('.stylitics-card img').each(function () {\n var imageUrl = jQuery(this).attr('src');\n if (imageUrl) {\n bouncex.push(['view_collection', {\n image_url: bouncex.utils.url.allowParams([], imageUrl),\n item_url: itemUrl\n }]);\n }\n });\n}\n\n/* ---------------------------- CATEGORY TRACKING --------------------------- */\n\nfunction getItemIdsCat() {\n var ids = [];\n\n jQuery('#productGridItems .product-item-link').each(function (i, e) {\n var id = getIdFromUrl(jQuery(e).attr('href'));\n\n if (id && ids.indexOf(id) < 0) {\n ids.push(id);\n }\n });\n\n return ids.join(',');\n}\n\nfunction getCategoryObject() {\n return {\n 'page:url': CLEAN_URL,\n 'items:ids': getItemIdsCat()\n };\n}\n\nfunction initializeCategoryEvents() {\n var categoryObj;\n\n bouncex.et.onTrue(\n function () {\n categoryObj = getCategoryObject();\n return !!categoryObj['items:ids'].length &&\n !!categoryObj['page:url'];\n },\n function () {\n bouncex.push(['view category', categoryObj]);\n captureCategory();\n },\n 10\n );\n\n initializeATCTracking();\n}\n\nfunction captureCategory(){\n if (bouncex.website.pts === 'category'){\n var catCode = bouncex.utils.getNestedProp('CLEAN_URL','',window).split('/').pop();\n if (catCode) {\n _shq.push(['onCategory', {\n 'catName': catCode,\n 'catId': catCode\n }]);\n }\n }\n}\n\nfunction initializeQuickView() {\n var id;\n\n bouncex.et.onVarChange('quick_view_open', function (oldVal, newVal) {\n if (newVal) {\n id = getIdFromUrl(jQuery('.quick-buy__link').attr('href'));\n\n if (id) {\n fireViewItem(id);\n }\n }\n });\n}\n\n/* ------------------------------- CART EVENTS ------------------------------ */\n\nfunction fireAddToCart(itemId) {\n bouncex.push(['add to cart', { 'item:id': itemId }]);\n\n if (bouncex.vars.cart) {\n return;\n }\n bouncex.setVar('cart', true);\n}\n\nfunction initializeATCTracking() {\n var itemId;\n bouncex.et.onVarChange('cart_qty', function (oldVal, newVal) {\n if (newVal > oldVal) {\n itemId = bouncex.vars.quick_add_item_id;\n if (itemId) {\n fireAddToCart(itemId);\n }\n }\n });\n}\n\nfunction initializeATCClickTracking(itemId) {\n bouncex.off(bouncex.document, 'click.bxatc', ATC_SELECTOR);\n bouncex.et.on(bouncex.document, 'click.bxatc', function () {\n fireAddToCart(itemId);\n }, ATC_SELECTOR);\n}\n\nfunction emptyCart(){\n if (bouncex.website.pts === 'cart' && bouncex.vars.cart){\n bouncex.et.onVisible('.emptyBagBlock', function(){\n bouncex.push(['empty_cart']);\n bouncex.setVar('cart', false);\n });\n }\n}\n\nfunction initializeCartEvents() {\n bouncex.et.cart.init({\n replenish: function () { },\n replenishmentType: 'single'\n });\n\n emptyCart();\n}\n\n/* --------------------------- INITIALIZE TRACKING -------------------------- */\n\nfunction isValidDomain() {\n return CLEAN_URL.indexOf('bodenusa.com') > -1 && CLEAN_URL.indexOf('stage') === -1;\n}\n\nfunction isEn() {\n return bouncex.html.attr('lang').indexOf('en') > -1;\n}\n\nfunction isValidForTracking() {\n return isValidDomain() && isEn();\n}\n\nfunction init() {\n if (!isValidForTracking()) {\n return;\n }\n\n initializeCartEvents();\n\n switch (bouncex.website.pts) {\n case 'category':\n case 'search':\n initializeCategoryEvents();\n initializeQuickView();\n break;\n case 'product':\n bouncex.setTimeout2(initializeItemEvents, 1000);\n break;\n default:\n break;\n }\n}\n\ninit();\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":"checkout.bodenusa.com"}],[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === '/en-US/'"}]]},"category":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"bouncex.utils.getNestedProp('br_data.ptype') === 'category';"}]]},"checkout":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"checkout.bodenusa.com/en-US/Order/"}]]},"home":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === '/' || window.location.pathname === '/en-us';"}]]},"product":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"bouncex.utils.getNestedProp('br_data.ptype') === 'product';"}]]},"search":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/search?"}]]}},"els":{"blank_site_element":""},"vars":[{"name":"logged_in","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function(){\n if (jQuery('.header-rd__account-dropdown').length === 0) {\n return null;\n } else {\n return jQuery('.header-rd__account-dropdown').first().text().indexOf('Hello') > -1;\n }\n})();","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":"(function(){\n if(bouncex.website.pts === 'checkout' || bouncex.website.pts === 'cart') {\n return bouncex.utils.getNestedProp('_satellite.getVar', function(){})('CC: Number of items in cart') || 0;\n } else {\n return Number(jQuery('.header-rd__mini-basket-count').first().text());\n }\n})();","trigger":""},{"name":"cart_value","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"0","code":"(function(){\n if(bouncex.website.pts === 'checkout' || bouncex.website.pts === 'cart') {\n return bouncex.utils.getNestedProp('_satellite.getVar', function(){})('CC: shoppingBag.value.gross') || 0;\n } else {\n return Number(jQuery('.header-rd__mini-basket-price').first().text().replace(/[^0-9.]/g, ''));\n }\n})();","trigger":""},{"name":"prod_price","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"","trigger":""},{"name":"prod_name","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"","trigger":""},{"name":"in_stock","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"","trigger":""},{"name":"submitted_onsite","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"window.location.href.indexOf('/Secure/EmailSignup.aspx') > -1","trigger":""},{"name":"page_url","polling":"none","persist":"no","page_types":["category","search"],"testmode":true,"default":"false","code":"","trigger":""},{"name":"cart_token","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"null;","trigger":"pageload"},{"name":"cart_items","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"null;","trigger":"pageload"},{"name":"cart","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"cookie_modal_present","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('#onetrust-banner-sdk:visible').length > 0;","trigger":"pageload"},{"name":"page_type","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.website.pts;","trigger":"pageload"},{"name":"attentive_visible","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('#attentive_overlay').length > 0;","trigger":"pageload"},{"name":"item_id","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"bouncex.utils.url.allowParams().split('/').pop();","trigger":"pageload"},{"name":"quick_add_item_id","polling":"all","persist":"visit","page_types":["category","search"],"testmode":false,"default":"false","code":"(function(){\n var url = jQuery('.quick-buy__link').attr('href') || '',\n id = bouncex.utils.url.allowParams('', url).split('/').pop();\n\n return jQuery('.quick-buy__form').length > 0 && id || null;\n})();","trigger":"pageload"},{"name":"quick_view_open","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('.quick-buy').length > 0;","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":0,"mibcx":1,"te":1,"cart_rep":{"get":"","set":""},"ulpj":{"mi_u":"espemailid"},"cus":"","miw_exclude":"","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":1,"spatm":0,"preinit_cjs":"","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"","eventSharing":true,"shqId":"jcju20jnde-1","enabled":1},"pde":true,"fmc":["AW","AI","AG","AR","BS","BB","BZ","BM","BO","BQ","BR","CA","KY","CL","CO","CR","CU","CW","DM","DO","EC","SV","GF","GL","GD","GT","GP","HT","HN","JM","MQ","MX","MS","NI","PA","PY","PE","PR","PM","MF","BL","KN","LC","VC","SX","SR","TT","US","UM","UY","VE","VG","VI"],"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":"","ga4_measurement_id":""} ; 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: 0 }; bouncex.assets = {"ads":"44fda29a3ca8b3798fe72ceb2caeade8","creativesBaseStyles":"a53944a2","gpsAuction":"1375a7b38c31e98d14fe7f396b72da14","inbox":"02aca5df0e176b8810a86da97ac05424","onsite":"0e56ab6ba004ee080ce3deb3edae35e9","sms":"e39203556bab2366e56296ce42e974a7","websdk":"0704dae1eb637cbeb4a847506058402d"}; 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.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_b0f9dea1e3910d3b6e492e0d6dab8565.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(); }})();