(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":4364,"name":"On Running EN-US","cookie_name":"bounceClientVisit4364","domain":"on-running.com","ct":"fp_local_storage","ally":0,"ei":0,"tcjs":"","cjs":"","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":1},"burls":[],"ple":false,"fbe":true,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"bouncex.et.item.requireImageLoad = false;\n// last update: 6/23/2022 - BK\n// Use 4364 as the master and update all subsequent templates accordingly.\n\n// To add SHQ tracking to this template, add 'trackSHQ: true' to the configObj for the WID.\n// Then, copy & paste this exact template to WIDs 4364 - 4370.\n\nvar configObj = {\n '4364': {\n websitePath: 'en-us',\n sizeFormat: 'US',\n trackSHQ: true,\n fireCountryCode: true\n },\n '4365': {\n websitePath: 'en',\n sizeFormat: 'UK'\n },\n '4366': {\n websitePath: 'de-ch',\n sizeFormat: 'EU'\n },\n '4367': {\n websitePath: 'en-ch',\n sizeFormat: 'EU'\n },\n '4368': {\n websitePath: 'fr-ch',\n sizeFormat: 'EU'\n },\n '4369': {\n websitePath: 'de-de',\n sizeFormat: 'EU'\n },\n '4370': {\n websitePath: 'en-de',\n sizeFormat: 'EU'\n },\n '5185': {\n websitePath: 'en-ca',\n sizeFormat: 'US'\n },\n '5186': {\n websitePath: 'fr-ca',\n sizeFormat: 'EU'\n },\n '5187': {\n websitePath: 'ja-jp',\n sizeFormat: 'JP'\n }\n },\n config = createConfig(),\n AVAILABLE_SIZES_SELECTOR = '[data-wk-name=\"purchasePodSizeOption\"]',\n CLEAN_URL = bouncex.utils.url.allowParams();\n\n/* --------------------------------- HELPERS -------------------------------- */\n\nfunction createConfig() {\n var atcTranslations = {\n en: 'Add to cart',\n de: 'In den Warenkorb',\n fr: 'Ajouter au panier'\n },\n config = configObj[bouncex.website.id];\n\n config.language = config.websitePath.split('-')[0];\n config.addToCartString = atcTranslations[config.language];\n config.websiteUrl = 'www.on.com/' + config.websitePath;\n\n return config;\n}\n\nfunction isValidForTracking() {\n return CLEAN_URL.indexOf(config.websiteUrl) > -1\n && (jQuery('html').attr('lang') || '').indexOf(config.language) > -1;\n}\n\nfunction getProdIdFromUrl(url) {\n var noParams = url ? bouncex.utils.url.allowParams([], url) : '',\n prodInfo = noParams.split('/products/')[1] || '';\n return prodInfo.replace(/\\//g, '-').toLowerCase();\n}\n\nfunction getImageUrl(){\n var $imageSet = jQuery('[data-wk-name=\"pdpGallery\"]').attr('data-wk-main-image'),\n $image;\n\n if (!$imageSet){\n return false;\n }\n\n\t$image = $imageSet.split(',')[0];\n\treturn bouncex.utils.url.allowParams('', $image);\n}\n\n// this exclusion tag provided by the client is GEO specific\n// the same product can be excluded from one GEO and not for another\n// SOTEC-2729 All other exclusions removed 8/2023\nfunction excludedProductFromClientTag() {\n var data = window.dataLayer,\n itemComingSoon = jQuery('[aria-label^=\"info-banner\"]').text().toLowerCase().indexOf('coming soon') > -1;\n for (var i = data.length - 1; i > 0; i--) {\n if (data[i].event && data[i].event === 'view_item') {\n return data[i].wk_campaign_exclusion;\n }\n }\n return itemComingSoon;\n}\n\nfunction inStock(){\n var sizeSelectors = jQuery('input[name=\"size-selector\"]');\n\n if (!sizeSelectors.length){\n return jQuery('[data-wk-name=\"purchasePodAddToCartBtn\"]').length > 0;\n }\n\n var inStockSizes = sizeSelectors.filter(function(){\n var tID = jQuery(this).attr('data-test-id');\n return tID && tID !== 'sizeOutOfStock';\n });\n return inStockSizes.length > 0;\n}\n\n/* ------------------------------ ITEM TRACKING ----------------------------- */\n\nfunction getItem() {\n var itemId = getProdIdFromUrl(jQuery('[data-wk-name=\"purchasePodColorSelected\"]').first().attr('href')) || '',\n groupId = itemId.split('-').pop();\n return {\n id: itemId,\n copy: jQuery('[data-wk-name=\"purchasePodProductName\"]').text(),\n category: jQuery('[data-wk-name=\"purchasePodBreadcrumbs\"]').text() || 'Global',\n url: CLEAN_URL,\n imageurl: getImageUrl() || '',\n instock: bouncex.vars.in_stock,\n excluded: excludedProductFromClientTag(),\n badge_value: jQuery('[data-wk-name=\"purchasePodProductBadge\"]').first().text(),\n price: jQuery('[data-wk-name=\"purchasePodProductPrice\"]').text().replace(/[^0-9.]/g,''),\n groupid: groupId.toUpperCase()\n };\n}\n\nfunction fireViewItem(id, groupId) {\n var pushItem = { 'item:id': id };\n\n if (groupId) {\n pushItem['item:itemgroupid'] = groupId;\n }\n bouncex.push(['view item', pushItem]);\n}\n\nfunction initializeItemEvents() {\n var item;\n\n bouncex.et.onTrue(\n function () {\n item = getItem();\n\n return !!item.id &&\n !!item.copy &&\n !!item.category &&\n !!item.url &&\n !!item.imageurl &&\n !!item.groupid;\n },\n function () {\n if (item.url.indexOf('gift-card') > -1) {\n return;\n }\n bouncex.push(['item', item]);\n initializeSkuEvents(item.id, item.groupid);\n fireViewItem(item.id, item.groupid);\n initializeATCClickTracking(item.id);\n\n bouncex.setTimeout2(function(){\n bouncex.push(['view_five_seconds']);\n }, 5000);\n },\n 10\n );\n}\n\n/* ------------------------------ SKU TRACKING ------------------------------ */\n\nfunction initializeSkuEvents(itemId, groupId) {\n var skuId = getSku(),\n lastSkuFired;\n if (jQuery(AVAILABLE_SIZES_SELECTOR).length < 2) {\n fireSelectSku(itemId, groupId, skuId);\n }\n bouncex.et.on(\n bouncex.document, 'click.bxsku', function () {\n bouncex.et.onTrue(function () {\n skuId = getSku();\n return skuId && skuId !== lastSkuFired && skuId.indexOf(groupId) > -1;\n }, function () {\n fireSelectSku(itemId, groupId, skuId);\n lastSkuFired = skuId;\n }, 10);\n },\n AVAILABLE_SIZES_SELECTOR);\n}\n\nfunction fireSelectSku(itemId, groupId, skuId) {\n if (itemId && groupId && skuId) {\n bouncex.push(['select_sku', {\n 'item:id': itemId,\n 'item:itemgroupid': groupId,\n 'item:feedid': skuId\n }]);\n }\n}\n\nfunction getSku() {\n var data = window.dataLayer,\n skuId = '';\n\n for (var i = data.length - 1; i > 0; i--) {\n if (data[i].full_sku) {\n skuId = data[i].full_sku;\n break;\n }\n }\n return skuId;\n}\n\n/* ---------------------------- CATEGORY TRACKING --------------------------- */\n\nfunction getItemIdsCat() {\n var ids = [];\n\n jQuery('[data-wk-name=\"productCardLink\"]').each(function (i, e) {\n var id = getProdIdFromUrl(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 },\n 10\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\n// USE FOR INITIALIZING ATC EVENTS USING CLICK LISTENERS ONLY\nfunction initializeATCClickTracking(itemId) {\n bouncex.et.on(bouncex.document, 'click.bxatc', function () {\n fireAddToCart(itemId);\n }, '[data-wk-name=\"purchasePodAddToCartBtn\"], [data-wk-name=\"contextNav\"] button, button[aria-label=\"Add to cart\"], button[aria-label=\"Add to bag\"]');\n}\n\nfunction emptyCart() {\n bouncex.et.onVarChange('cart_qty', function (oldVal, newVal) {\n if (bouncex.vars.cart && newVal === 0 && oldVal > 0) {\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/* ------------------------------ USER TRACKING ----------------------------- */\n\nfunction getEmail() {\n var data,\n userKey;\n\n switch (true) {\n case bouncex.website.pts === 'checkout':\n return jQuery('.checkout-info-tile__details').text();\n case window.location.pathname.indexOf('/account') > -1:\n return jQuery('.account-block__info-cell').last().text();\n default:\n data = !!window.$nuxt && !!window.$nuxt.context && !!window.$nuxt.context.apolloClient\n && !!window.$nuxt.context.apolloClient.cache && !!window.$nuxt.context.apolloClient.cache.data\n && window.$nuxt.context.apolloClient.cache.data.data || [],\n userKey = Object.keys(data).filter(key => key.indexOf('email') > -1);\n\n return userKey.length > 0 ? userKey[0].split('email\":\"').pop().split('\"').shift() : '';\n }\n}\n\nfunction initializeUserTracking() {\n var userEmail;\n\n if (bouncex.vars.logged_in_identified) {\n return;\n }\n\n bouncex.et.onVarChange('logged_in', function (oldVal, newVal) {\n if (!bouncex.vars.logged_in_identified && newVal) {\n bouncex.et.onTrue(\n function () {\n userEmail = getEmail();\n return bouncex.utils.validate.email(userEmail);\n },\n function () {\n bouncex.push([\n 'user',\n {\n 'email': userEmail,\n 'source': 'LoggedIn'\n }\n ]);\n bouncex.setVar('logged_in_identified', true);\n },\n 10\n );\n }\n });\n}\n\n/* ---------------------------- INITIALIZE EVENTS ---------------------------- */\n\nfunction init() {\n if (!isValidForTracking()) {\n return;\n }\n\n initializeUserTracking();\n initializeCartEvents();\n\n switch (bouncex.website.pts) {\n case 'category':\n bouncex.setTimeout2(initializeCategoryEvents, 5000);\n break;\n case 'product':\n // Adding timeout to prevent item ids with multiple images.\n // There is a lag between changing colors and new image carousel loading\n bouncex.setTimeout2(function() {\n initializeItemEvents();\n }, 2500);\n break;\n default:\n break;\n }\n\n if (bouncex.cookie.vpv === 1 && config.fireCountryCode) {\n bouncex.push([bouncex.state.geo.country_code + '_visitor', {}]);\n }\n}\n\ninit();\n\n/* SHQ TRACKING */\nif (config.trackSHQ) {\n document.addEventListener('search', function () {\n var sp = document.querySelector('.site-search__input').value;\n if (sp) {\n _shq.push(['pageView', {\n pageType: 'search',\n searchPhrase: sp\n }]);\n }\n });\n\n bouncex.et.onTrue(function () {\n return bouncex.utils.getNestedProp('window._shq.loaded');\n }, function () {\n // instandiate dl handler object\n var dh = new _shq.DataLayerHandler(window.dataLayer);\n // target atc events with 'gtmEcomAddToCart' value\n dh.watch(function (e) {\n var prodObj = bouncex.utils.getNestedProp('ecommerce.add.products', null, e)[0];\n if (prodObj.id && prodObj.price) {\n _shq.push(['onCartAdd', {\n Items: [{\n ProductId: prodObj.dimension30,\n UnitPrice: prodObj.price,\n Quantity: prodObj.quantity ? prodObj.quantity : 1\n }],\n Total: bouncex.vars.cart_value || null\n }]);\n }\n }, { filter: function (e) { return e.event === 'gtmEcomAddToCart'; } });\n });\n}\n","dge":true,"bxidLoadFirst":false,"pie":false,"cme":true,"gbi_enabled":0,"bpush":false,"pt":{"cart":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/cart"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"on-shop-2084.on-running.com"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"staging.on-running.com"}]]},"category":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/en-us/explore"},{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/en-us/collection"},{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/en-us/stories"},{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/en-us/shop"}]]},"checkout":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/checkout"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"/confirmation"}]]},"home":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"['/en-us', '/en-us/'].indexOf(window.location.pathname) > -1;"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"customer-service.on-running.com"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"localhost"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"staging.on-running.com"}]]},"product":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/products/"}],[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/en-us/"}]]},"search":{"testmode":true,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":""}]]}},"els":{"blank_site_element":""},"vars":[{"name":"logged_in","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n var data,\n userKey;\n\n if (bouncex.website.pts === 'checkout') {\n return jQuery('.checkout-info-tile__edit-text').text().toLowerCase().indexOf('log out') > -1;\n } else if (window.location.pathname.indexOf('/account') > -1) {\n return true;\n } else {\n data = !!window.$nuxt && !!window.$nuxt.context && !!window.$nuxt.context.apolloClient\n && !!window.$nuxt.context.apolloClient.cache && !!window.$nuxt.context.apolloClient.cache.data\n && window.$nuxt.context.apolloClient.cache.data.data || [],\n userKey = Object.keys(data).filter(key => key.indexOf('User:{\"email\":') > -1);\n\n return userKey.length > 0;\n }\n})();","trigger":""},{"name":"ever_logged_in","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in || null;","trigger":""},{"name":"cart_qty","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"(function(){\n if (window.location.pathname.indexOf('/account') > -1 || bouncex.website.pts === 'checkout') {\n return null;\n } \n if (jQuery('[class*=\"emptyCartMobileTitle\"], [class*=\"emptyCartTitle\"]').text().indexOf('cart is empty') > -1) {\n return 0;\n }\n \n var cartQty = Number(jQuery('[class*=\"itemQuantity\"]').first().text().replace(/[^0-9.]/g, ''));\n\n return isNaN(cartQty) ? null : cartQty;\n})();","trigger":""},{"name":"cart_value","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"(function(){\n if (window.location.pathname.indexOf('/account') > -1) {\n return null;\n } \n if (jQuery('[class*=\"emptyCartTitle\"]').length > 0) {\n return 0;\n }\n\n return Number(jQuery('[data-wk-name=\"cartAmountWithCurrency\"], .order-totals-row__amount').last().text().replace(/[^0-9.]/g, '')) || null;\n})();","trigger":""},{"name":"prod_price","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('[data-wk-name=\"purchasePodProductPrice\"]').text().replace(/[^0-9.]/g, '');","trigger":""},{"name":"prod_name","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('[data-wk-name=\"purchasePodProductName\"]').text();","trigger":""},{"name":"in_stock","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('[data-wk-name=\"purchasePodAddToCartBtn\"] span').text().indexOf(\"Add to bag\") > -1 ? true : false","trigger":""},{"name":"submitted_onsite","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"jQuery('[class*=\"src-components-organisms-Footer-newsletterIconList\"] p[class*=\"text\"]').eq(1).is(':visible') || null;","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":true,"default":"false","code":"null;","trigger":"pageload"},{"name":"external_traffic","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n var index = 0;\n \n for (index; index < dataLayer.length; index++) {\n if (dataLayer[index]['event'] === 'initial-meta' && dataLayer[index]['externalTraffic'] === 'true') {\n return true;\n }\n }\n})();","trigger":"pageload"},{"name":"cart_set","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"group_id","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(bouncex.utils.url.allowParams() || '').split('-').pop() || false;","trigger":"pageload"},{"name":"logged_in_identified","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"consent_banner","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('.is-slid-up').length > 0 || jQuery('#onetrust-policy-title:visible').length > 0;","trigger":"pageload"},{"name":"accepted_website_functionality_cookie","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var cookieObject = bouncex.utils.url.queryStringToObject(bouncex.utils.cookies.read(\"OptanonConsent\"));\n var groupSplit = (cookieObject.groups || '').split('C0003:');\n if (groupSplit.length > 1) {\n return groupSplit[1][0] === '1';\n }\n return false;\n})();","trigger":"pageload"},{"name":"accept_cookies_banner","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var cookieObject = bouncex.utils.url.queryStringToObject(bouncex.utils.cookies.read(\"OptanonConsent\"));\n var groups = cookieObject.groups || '';\n \n if (groups.length) {\n return groups.indexOf(':0') === -1;\n }\n \n return false;\n})();","trigger":"pageload"},{"name":"window_wknd_suppress","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"window.wknd_suppress === true ? true : false;","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":"#fb-email-to","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":1,"spatm":0,"preinit_cjs":"var audiences = {\n testMode: false,\n interceptEnabled: true,\n mirrorEnabled: true,\n arrayObserverEnabled: true, \n\n useIntercept: function () {\n if (this.interceptEnabled) {\n bouncex.utils.shqInterceptEvent = {\n 'categoryView': true,\n 'cartAdd': true,\n 'productView': true,\n 'purchase': true\n };\n }\n },\n useMirror: function () {\n if (this.mirrorEnabled) {\n bouncex.utils.shqMirrorEvent = {\n 'pageview': function() {\n if (bouncex.website.pts === 'category'){\n var catCode = window.location.pathname.split('/').pop();\n if(catCode){\n _shq.push(['onCategory', {\n 'catName': catCode,\n 'catId': catCode,\n }]);\n }\n }\n },\n 'user': function (wkdata) {\n var em = bouncex.utils.getNestedProp('params', null, wkdata)['user:email'] || '',\n emType = 'account';\n if (!!em && bouncex.website.pts !== 'checkout') {\n var userInputId = bouncex.utils.getNestedProp('params', null, wkdata)['user:input_id'];\n if ( (!!userInputId && userInputId === 'email') || (!!userInputId && userInputId.indexOf('bx-element-') > -1) ) {\n emType = 'marketing';\n }\n _shq.push(['onEmail', {\n type: emType,\n email: em\n }]);\n }\n }\n };\n }\n },\n captureSearch: function captureSearch(obj){\n var searchTerm = bouncex.utils.getNestedProp('search_term', '',obj);\n if (searchTerm){\n _shq.push([ 'onSearch',{\n 'searchPhrase': searchTerm\n }]);\n }\n },\n capturePDP: function capturePDP(obj){\n var prodId = bouncex.utils.getNestedProp('ecommerce.items[0].item_id', '',obj);\n if(prodId){\n _shq.push(['onProductView', {\n productId: prodId\n }]);\n }\n },\n captureATC: function captureATC(obj){\n var atcArray =bouncex.utils.getNestedProp('ecommerce.items', [], obj).map(function(item){\n return {ProductId: item.full_sku, UnitPrice: item.price, Quantity: item.quantity};\n });\n\n if (atcArray && atcArray.length > 0){\n _shq.push(['onCartAdd', {'Items': atcArray }]);\n }\n\n },\n captureCart: function captureCart(obj){\n var cartItems =bouncex.utils.getNestedProp('ecommerce.items', [], obj).map(function(item){\n return {ProductId: item.full_sku, UnitPrice: item.price, Quantity: item.quantity};\n }),\n cartTotal = cartItems && cartItems.reduce((sum, currentItem) => {\n return sum + (currentItem.UnitPrice * currentItem.Quantity);\n }, 0);\n if(cartItems && cartItems.length > 0 && cartTotal > 0){\n _shq.push([ 'onCartView', {\n 'Items': cartItems,\n 'Total': cartTotal\n }]);\n }\n },\n capturePurchase: function capturePurchase(obj){\n var prodErr = false;\n var orderId = bouncex.utils.getNestedProp('on.order.number', null, obj);\n var orderInfo = bouncex.utils.getNestedProp('on.order.products', null, obj);\n var orderArray = orderInfo && orderInfo.map(function (ea) {\n return { productId: ea.sku, price: ea.price, qty: ea.quantity };\n });\n var purchTotal = orderArray && orderArray.reduce((sum, currentItem) => {\n return sum + (Number(currentItem.price) * Number(currentItem.qty));\n }, 0);\n\n if (orderArray.length < 1) {\n prodErr = true;\n }\n\n if (!prodErr && orderId){\n _shq.push(['onPurchase',{\n 'orderItems' : orderArray,\n 'orderId': orderId,\n 'total': purchTotal\n }]);\n }else{\n _shq.push(['onPurchase',{\n 'orderId' : orderId || 'NoOrderId-' + randomNumber(),\n 'usebasket': true\n }]);\n }\n },\n processObserver: function processObserver(aoItems) {\n var searchDone = false;\n // aoItems will be an array of objects\n while (aoItems.length) {\n var item = aoItems.shift();\n if(bouncex.utils.getNestedProp('event', '',item) === 'view_item'){\n this.capturePDP(item);\n }\n if(bouncex.utils.getNestedProp('event', '',item) === 'add_to_cart'){\n this.captureATC(item);\n }\n if(bouncex.utils.getNestedProp('event', '',item) === 'view_cart'){\n this.captureCart(item);\n }\n if(bouncex.utils.getNestedProp('event', '',item) === 'rockerBoxPurchase'){\n this.capturePurchase(item);\n }\n if(bouncex.utils.getNestedProp('event', '',item) === 'search' && !searchDone){\n this.captureSearch(item);\n searchDone = true;\n }\n }\n },\n arrayObserver: function arrayObserver() {\n var _this = this;\n if (!this.arrayObserverEnabled) {\n return;\n }\n bouncex.et.onTrue(function () {\n return bouncex.utils.getNestedProp('window._shq.loaded');\n }, function () {\n _shq.ArrayObserver(window.dataLayer, function (e) {\n _this.processObserver(e);\n });\n\n });\n },\n /* Initialize Segments Tracking */\n init: function init () {\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.audiences = this;\n // initialize intercept and mirror, comment out if not needed\n this.useIntercept();\n this.useMirror();\n this.arrayObserver();\n \n }\n};\naudiences.init();","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"Send this text to sign-up for automated, recurring On Running EN-US marketing texts, like cart reminders.","eventSharing":true,"shqId":"ox82thn6kj-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":"#fb-email-to","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":"","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":"bb795faa3645fe2b9f103307baeb4457","creativesBaseStyles":"a53944a2","gpsAuction":"4c2f55cfb6b81a4b5a1dd966c7c4d150","inbox":"02aca5df0e176b8810a86da97ac05424","onsite":"0e56ab6ba004ee080ce3deb3edae35e9","sms":"e39203556bab2366e56296ce42e974a7","websdk":"c9f501637572c332d19cc93fe96d6f6c"}; 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_f76bc8dd6d7924b7125a38d22086b896.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"}]; 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(); }})();