(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":3055,"name":"HelloFresh","cookie_name":"bounceClientVisit3055","domain":"hellofresh.com","ct":"fp_local_storage","ally":1,"ei":0,"tcjs":"","cjs":"/*** https://www.wrike.com/open.htm?id=598680219 ***/\nbouncex.report_ga = function(action, label, bypass) {\n bypass = typeof(bypass)!='undefined' && !!bypass;\n if (typeof(action)!='string'||typeof(label)!='string') return;\n var interaction = false;\n // enforce case convention\n if (!bypass) {\n action = action.charAt(0).toUpperCase() + action.slice(1).toLowerCase();\n interaction = action=='Impression';\n action = 'Wunderkind ' + action;\n }\n dataLayer.push({\n event: \"gaEventTrigger\",\n gaEventCategory: \"Wunderkind\",\n gaEventAction: action,\n gaEventLabel: label,\n gaNonInteraction: interaction\n });\n};\n\n/* wrike: https://www.wrike.com/open.htm?id=614034324 */\nfunction addVoucherOnCheckout() {\n if( bouncex.vars.bx_trigger_external_action === true && jQuery('h3:contains(\"Order Summary\"), h3:contains(\"Order summary\")').length > 0 && window.location.href.indexOf('checkout-form/address') > -1 ){\n var currUrl = window.location.href,\n newUrl = window.location.origin + window.location.pathname + '?c=G3-F8FGA&discount_comm_id=69a00013-80db-4f6e-8cdb-87ca07973397&mealsize=3-2&dis_channel=wknd&dm_custom=bfast';\n \n bouncex.log('append coupon and mealsize to url');\n if (currUrl !== newUrl) {\n window.location.replace(newUrl);\n }\n bouncex.log('add coupon on checkout page');\n window.triggerExternalAction('addVoucher', 'G3-F8FGA');\n bouncex.setVarAndReload('bx_trigger_external_action', true);\n } \n}\n\nbouncex.setTimeout2(addVoucherOnCheckout, 2500);\n\n/* https://www.wrike.com/open.htm?id=681101755 */\nbouncex.setVarAndReload('novoucher_evergreen_offer', '14 Free Meals');\n\n","force_https":false,"waypoints":false,"content_width":0,"gai":"UA-27893453-9","swids":"","sd":0,"ljq":"auto","campaign_id":0,"is_preview":false,"aco":{"first_party_limit":"3500","local_storage":"1"},"cmp":{"gdpr":1},"burls":[{"prop":"contains","val":"blockbxall=1"},{"prop":"contains","val":"datenight"}],"ple":false,"fbe":true,"mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"/* prevent our tag from loading images */\nbouncex.et.item.requireImageLoad = false;\nvar menuPageUrl = 'https://www.hellofresh.com/menus/',\n tileImageSelector = 'img.dsr',\n legacySelectPlanButton = 'div[role=\"button\"]',\n desktopSelectPlanButton = '[data-test-id=\"select-plan-button\"]',\n mobileContinueButton = '[data-test-id=\"single-page-continue-button\"]';\n\nvar nameDescriptionMap = {\n 'classic': 'Our widest variety of meat, fish, and seasonal produce.',\n 'meat & veggies': 'Our widest variety of meat, fish, and seasonal produce.',\n 'veggies': 'Vegetarian recipes with plant-based proteins, grains, and seasonal produce.',\n 'veggie': 'Vegetarian recipes with plant-based proteins, grains, and seasonal produce.',\n 'family': 'Quick and easy meals with all the YUM-worthy flavor the whole family loves.',\n 'family friendly': 'Quick and easy meals with all the YUM-worthy flavor the whole family loves.',\n 'calorie smart': 'Wholesome recipes around 650 calories, curated by our certified nutritionists.',\n 'pescatarian': 'Our Pescatarian preference features a combo of veggie and seafood meals.',\n 'quick & easy': 'Quick prep, easy clean up and one-pot',\n 'quick': 'Quick prep, easy clean up and one-pot'\n};\n// 'none' - for preselected default option, which is Meat & Veggoes\nvar idNameMap = {\n 'meat&veggies': 'Meat & Veggies',\n 'none': 'Meat & Veggies',\n 'veggie': 'Veggies',\n 'family': 'Family Friendly',\n 'fit': 'Calorie Smart',\n 'pescatarian': 'Pescatarian',\n 'quick': 'Quick & Easy',\n 'chefschoice': 'Meat & Veggies'\n};\n\n/* ************************************** TRACK FREE BOX ***************************************/\n\n/* custom abandonment trigger event for users with free box */\nif (window.location.href.indexOf('c=FBO') > -1) {\n\tbouncex.push(['free_box', {}]);\n}\n\n/* ************************************** TRACK COUPON CODE ***************************************/\n\nbouncex.et.onVarChange('coupon_code', function(oldVal, newVal){\n\tif (newVal && !bouncex.vars.tracked_coupon){\n\t\tbouncex.push(['coupon', {\n\t\t\tcode: bouncex.vars.coupon_code\n\t\t}]);\n\t\tbouncex.setv('tracked_coupon', true);\n\t\tbouncex.setBounceCookie();\n\t}\n});\n\n/* ************************************** TRACK RECIPIES ***************************************/\n\n/* track recipes on menus page to populate global recommeded items */\nif (window.location.pathname.indexOf('menus') > -1) {\n bouncex.et.onHover(tileImageSelector, trackTile);\n}\n\nfunction trackTile(tile) {\n var itemData = getItemData(tile);\n var itemId = itemData.id;\n bouncex.push(['item', itemData]);\n bouncex.push(['view item', {'item:id' : itemId}]);\n}\n\nfunction getItemData(tile) {\n\tvar copy = tile.attr('alt');\n\tvar id = copy.split(' ').join('-').toLowerCase();\n\tvar imageUrl = tile.attr('src');\n\treturn {\n id: id,\n copy: copy,\n imageurl: imageUrl,\n category: 'Recepies',\n url: menuPageUrl,\n price: 1,\n instock: 1\n\t};\n}\n\n/* ************************************** TRACK SELECT PLAN ***************************************/\n\nif (window.location.pathname.indexOf('plans') > -1 ) {\n\n /* fire custom select_plan event for old design pages */\n bouncex.et.on(bouncex.document, 'click.wknd-legacy', trackSelectPlanLegacy, legacySelectPlanButton);\n\n // desktop \"select this plan\" button\n bouncex.et.on(bouncex.document.find('#hf-plans'), 'click.wknd-desktop', trackSelectPlanNew, desktopSelectPlanButton);\n\n // mobile \"continue\" button on last step of plan select\n\n bouncex.et.on(bouncex.document.find('#mainContent'), 'click.wknd-mobile', function(){\n if(bouncex.utils.url.getParam('step') === '5') {\n trackSelectPlanNew();\n }\n }, mobileContinueButton);\n}\n\nfunction trackSelectPlanLegacy(data) {\n bouncex.log('track Select Plan');\n var innerText = data.currentTarget.innerText || '';\n var planName = getPlanName(innerText);\n bouncex.setv('plan_name', planName);\n bouncex.setBounceCookie();\n}\n\nfunction getPlanName(text) {\n return text.split('Plan')[0].trim();\n}\n\nfunction trackSelectPlanNew() {\n bouncex.log('track select plan new');\n var selectedPlanName = getPlanNameFromDataLayer() || bouncex.vars.plan_name;\n var selectedPlanDescription = mapNameToDescription(selectedPlanName.toLowerCase());\n bouncex.push(['select_plan', {\n plan_name: selectedPlanName,\n plan_description: selectedPlanDescription\n }]);\n}\n\nfunction getPlanNameFromDataLayer() {\n\tbouncex.log('getPlan from Datalayer');\n\n var prefObjs = window.dataLayer.filter(function(el) {\n return el.gaEventAction === 'ProductPreferenceDefault';\n });\n\n var lastPref = prefObjs.length && prefObjs.slice(-1)[0];\n\tvar objName = lastPref && (lastPref.gaEventLabel || '').split('|')[1];\n\n\tbouncex.log('objName', objName);\n\tif (!idNameMap[objName]) {\n\t\tbouncex.err(objName);\n\t\tbouncex.err('Plan Not Found In Plan id to Name Map: Possible new plan or name change has occured. Check idNameMap.', 'tracking.js');\n\t}\n\n\treturn idNameMap[objName];\n}\n\nfunction mapNameToDescription(name) {\n bouncex.log('Name: ', name);\n return nameDescriptionMap[name] || nameDescriptionMap.classic;\n}\n\n/* ************************************** CUSTOM EVENTS **************************************/\n\n/* fire custom cancelled_member event to trigger Cancelled Member Abandonment */\nif (!bouncex.vars.active_member && bouncex.vars.cancelled_member && bouncex.vars.coupon_code) {\n\t\tbouncex.push(['cancelled_member']);\n}\n\n/* fire custom reactivate event to stop Cancelled Member Abandonment */\nif (bouncex.vars.active_member && !bouncex.vars.cancelled_member) {\n\t\tbouncex.push(['reactivate']);\n}\n\n// if (bouncex.testmode.bxdev) {\n // function detectActiveMembership(){\n // var url = bouncex.utils.url.allowParams();\n // var memberPath = 'https://www.hellofresh.com/my-account/deliveries/menu/';\n\n // if (url.indexOf(memberPath) > -1){\n // bouncex.push(['active_member', {'status': 'active '}]);\n // }\n // }\n// }\n\n/* ************************************** CUSTOM CANCEL SENDS ***************************************/\n\nfunction initCustomCancelSends() {\n var cParam = bouncex.utils.url.getParam('c'),\n cancelParams = ['FBO-', 'FIH-', 'HS-'],\n hasCancelParam = cancelParams.find(x => cParam.startsWith(x));\n\n if (hasCancelParam) {\n bouncex.push(['cancel_send', {}]);\n }\n}\n\ninitCustomCancelSends();\n\n/* ************************************** USER TRACKING **************************************/\n\nfunction initializeUserTracking() {\n\tif (!bouncex.vars.logged_in || !!bouncex.vars.logged_in_identified) {\n\t\treturn;\n\t}\n\n\tvar userEmail;\n\n\tbouncex.et.onTrue(\n\t\tfunction () {\n\t\t\tvar cookieInfo = bouncex.parseJSON(decodeURIComponent(bouncex.getBounceCookie('apiV2Auth')));\n\t\t\tuserEmail = bouncex.utils.getNestedProp('user_data.email', '', cookieInfo);\n\t\t\treturn bouncex.utils.validate.email(userEmail);\n\t\t},\n\t\tfunction () {\n\t\t\tbouncex.push([\n\t\t\t\t'user',\n\t\t\t\t{\n\t\t\t\t\temail: userEmail,\n\t\t\t\t\tsource: 'LoggedIn'\n\t\t\t\t}\n\t\t\t]);\n\t\t\tbouncex.setVar('logged_in_identified', true);\n\t\t},\n\t\t5\n\t);\n}\n\ninitializeUserTracking();\n\n/********************************************************************************\n SHQ Logic | Keeping these separate because they don\"t really fit with how the\n WKND logic is organized and there's really not much shared functionality.\n\n This is a pretty custom SHQ implementaiton so there will be quite a bit of\n logic needed to power SHQ tracking. All data is harvested from the dataLayer.\n\n*nameDescriptionMap and idNameMap are the only existing variables being used here\n*********************************************************************************/\n\n/******************\n Helper Functions\n*******************/\nfunction getPathEnd() {\n var urlSplit = window.location.pathname.split('/'),\n first = urlSplit.pop(),\n second = urlSplit.pop(); // in case the path name ends with a /\n\n return first ? first : second;\n}\n\n// dataLayer.find() only gives the first item added. I want the last.\nfunction filterDL(key, val) {\n return window.dataLayer ? window.dataLayer.filter(function (e) {\n return e[key] === val;\n }) : [];\n}\n\nfunction extractPlanDetails(id, cpd) {\n var idSplit = id ? id.split('-') : [];\n if (idSplit.length > 3 && !!cpd) {\n idSplit.pop(); // get rid of the last one\n cpd.familysize = idSplit.pop();\n cpd.mealnumber = idSplit.pop();\n }\n}\n\n// to create a unique order ID if we can\"t find one\nfunction randomNumber() {\n return Math.floor(Math.random() * 2000000000);\n}\n\n/***********************\n Customer Identification\n************************/\n/*\n Getting information about the user including their HF customer ID,\n their email addrss, and their active subscription ID. To avoid\n sending too many requests, we're keeping track of whether we have\n or have not collected each peice of pii for that session using the\n infoStore methods configured in the pre-init JS.\n*/\nfunction resolveCustomerInfo() {\n // getting the info store object for manipulation\n var infoStore = bouncex.infoStore.get(),\n crmObj = {};\n\n // If info store is an empty string, define it as an empty object\n if (!infoStore) { infoStore = {}; }\n\n // checking to see if we\"ve collected each peice of user info this session\n // If we haven\"t, then collect it\n\n // first, checking to see if all three have been collected. If they have, then don\"t bother.\n if (!(infoStore.shq_em && infoStore.shq_asid && infoStore.shq_cid)) {\n\n // I found that emails were not consistently being collected under oauth.\n // The email used for signing is expressed in the DL though so we can get it there.\n if (!infoStore.shq_em) {\n var email = bouncex.utils.gtmLookup('email');\n if (email) {\n _shq.push(['onEmail', {\n 'email': email,\n 'type': 'account'\n }]);\n infoStore.shq_em = true;\n }\n }\n if (!infoStore.shq_asid) {\n var asid = bouncex.utils.gtmLookup('activeSubscriptionId');\n if (asid) {\n crmObj.dwid = asid;\n infoStore.shq_asid = true;\n }\n }\n if (!infoStore.shq_cid) {\n var cid = bouncex.utils.gtmLookup('customerId');\n if (cid) {\n crmObj.cid = cid;\n infoStore.shq_cid = true;\n }\n }\n // This way we can do just one crm request instead of potentially two\n if (Object.keys(crmObj).length) {\n _shq.push(['onCrm', crmObj]);\n }\n\n // Putting info store data back where we found it along with any new bits.\n if (Object.keys(infoStore).length) {\n bouncex.infoStore.set(infoStore);\n }\n }\n}\n\n/***************************\n Map SHQ Events to Page Type\n****************************/\n// Handle SHQ Events\nvar shqEventMap = {\n 'view': function (details) {\n _shq.push(['pageView', {\n pageType: 'product',\n productId: details.id.toUpperCase(),\n scraped_products: details\n }]);\n },\n 'cart': function (details) {\n // Using cart view because you can only convert on one item at a time.\n _shq.push(['onCartView', {\n Items: [{\n ProductId: details.id,\n UnitPrice: details.price,\n Quantity: 1\n }],\n Total: details.price,\n scraped_products: details\n }]);\n },\n 'checkout': function () {\n // nothing special needs to happen on checkout\n // the checkout event fires automatically through the cartridge\n return false;\n },\n 'purchase': function (event) {\n if (event && typeof event === 'object') {\n var orderObj = {};\n orderObj.orderId = event.transactionID ? event.transactionID : 'noOrderId-' + randomNumber();\n orderObj.total = event.value;\n orderObj.pageType = 'purchase';\n orderObj.orderItems = event.items && event.items.length ? event.items.map(function (o) {\n if (o.sku) {\n return {\n productId: o.sku.toUpperCase(),\n qty: o.quantity,\n price: o.price\n };\n }\n }) : [];\n if (!orderObj.orderItems.length) {\n orderObj.usebasket = true;\n delete orderObj.items;\n }\n _shq.push(['pageView', orderObj]);\n }\n },\n 'other': function () {\n\n /*\n as a catch-all, we'll fire a category event so\n that any page visit is actionable to some extent\n */\n var pathend = getPathEnd();\n if (pathend) {\n _shq.push(['pageView', {\n 'pageType': 'category',\n 'catName': pathend,\n 'catId': pathend\n }]);\n }\n }\n};\n\n/**************************************\nProcess item object and dispatch events\n***************************************/\n\nfunction shqProcessItem(item) {\n // to make this a bit less verbose\n var gnp = bouncex.utils.getNestedProp;\n var cpd = {};\n // Determining if we're drilling into an add or checkout event to help keep things concise\n var isCheckout = !!bouncex.utils.getNestedProp('ecommerce.checkout', false, item),\n isClick = !!bouncex.utils.getNestedProp('ecommerce.click', false, item),\n isAdd = !!bouncex.utils.getNestedProp('ecommerce.add', false, item),\n conversionStatus,\n basePath; // This could be done with page type, but I want it bound to product data\n\n if (isCheckout) {\n basePath = 'ecommerce.checkout';\n conversionStatus = 'checkout';\n } else if (isAdd) {\n basePath = 'ecommerce.add';\n conversionStatus = 'cart';\n } else if (isClick) {\n basePath = 'ecommerce.click';\n conversionStatus = 'view';\n } else {\n basePath = 'ecommerce';\n conversionStatus = 'other';\n }\n\n // Constructing custom product details object\n cpd.id = gnp(basePath + '.products[0].id', null, item); // This ID is so they can output the ID in experiences\n cpd.productId_scraped = cpd.id ? cpd.id.toUpperCase() : null; // this is the key we use to tie custom details to other product behavior\n cpd.plan_category = gnp(basePath + '.products[0].category', null, item);\n cpd.plan_price = gnp(basePath + '.products[0].price', null, item);\n cpd.variant = gnp(basePath + '.products[0].variant', false, item);\n // they changed this property to be an array. We're grabbing the last item cause it's most recent\n cpd.variant = Array.isArray(cpd.variant) ? cpd.variant[cpd.variant.length -1] : cpd.variant;\n cpd.variantname = idNameMap[cpd.variant];\n cpd.variantdescription = nameDescriptionMap[cpd.variantname];\n cpd.eventlabel = gnp('gaEventLabel', null, item);\n cpd.coupon = gnp(basePath + '.products[0].coupon', null, item);\n cpd.coupon_indicator = cpd.eventLabel ? cpd.eventLabel.split('|').pop() : null;\n\n extractPlanDetails(cpd.id, cpd);\n\n if (cpd.id) {\n shqEventMap[conversionStatus](cpd);\n } else {\n _shq.push(['shq_debugger_log', 'productIdNotFound']);\n }\n}\n\n/*****************************\n Initialize SHQ Tracking Logic\n*****************************/\nfunction init_shq() {\n if (!window._shq) {\n return;\n }\n var thispage = getPathEnd();\n if (thispage === 'plans') {\n var controlLength = 0;\n // Monitoring for option switching on plan page\n bouncex.et.setInterval(function () {\n var dlItems = filterDL('event', 'gaEventTrigger_EE');\n if (dlItems.length > controlLength) {\n controlLength = dlItems.length;\n shqProcessItem(dlItems.pop());\n }\n });\n } else if (thispage === 'address') {\n shqProcessItem(filterDL('event', 'gaEventTrigger_EE').pop());\n } else if (thispage === 'checkout-success') {\n var orderEvent = filterDL('action', 'checkoutSuccess');\n if (orderEvent.length) {\n shqEventMap.purchase(orderEvent.pop());\n }\n } else {\n shqEventMap.other();\n }\n\n // attempt to collect\n resolveCustomerInfo();\n}\n\ninit_shq();\n","dge":true,"bxidLoadFirst":false,"pie":true,"cme":true,"gbi_enabled":0,"bpush":false,"pt":{"cart":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"jQuery('.hf-checkout-redirection').length > 0;"}]]},"category":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname.indexOf('/plans') > -1;"},{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname.indexOf('/tasty/wine/') > -1;"},{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname.indexOf('/gift') > -1;"},{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname.indexOf('/menus') > -1;"}]]},"checkout":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname.indexOf('/checkout-form/') > -1;"},{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname.indexOf('/checkout-form/address') > -1;"},{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname.indexOf('/checkout/finish') > -1;"}]]},"home":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === \"/\";"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"blog"}]]},"product":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname.indexOf('/recipes/') > -1;"}]]}},"els":{"native_capture_input_newsletter":"#txtEmailAddress","native_capture_input_registration":"#hf-registration-signup-email","native_capture_submit_newsletter":"span[data-translation-id=\"senf-footer.capture-email.subscribe\"]","native_capture_submit_registration":"div[data-test-id=\"auth-form-submit\"] button"},"vars":[{"name":"logged_in","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function () {\n if(window.location.pathname === '/plans' || window.location.pathname === '/checkout-form/address') {\n return jQuery('[data-test-id=\"navigation-step-Register\"] svg[data-test-id=\"completed-step-icon\"]').length > 0;\n }\n \n var cookieInfo = bouncex.parseJSON(decodeURIComponent(bouncex.getBounceCookie('apiV2Auth')));\n\t\tuserEmail = bouncex.utils.getNestedProp('user_data.email', '', cookieInfo);\n\t\tvalidEmail = bouncex.utils.validate.email(userEmail);\n return jQuery('#navigation-customer-name').length > 0 || validEmail;\n})();","trigger":""},{"name":"ever_logged_in","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in || null;","trigger":""},{"name":"submitted_onsite","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"jQuery('span:contains(\"Thank you for subscribing!\"):visible').length > 0 || jQuery('label[for=\"hf-registration-signin-password\"]:visible').length > 0 || jQuery('span:contains(\"Nice! You’re now subscribed to our email updates.\"):visible').length > 0 ? true : null;\n","trigger":""},{"name":"url_coupon","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var urlKey = 'c';\n var urlParam = bouncex.ibx._getparam(urlKey);\n if (urlParam) {\n return urlParam;\n }\n return null;\n})()","trigger":"pageload"},{"name":"offer","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"plan_in_cart","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"window.location.pathname.indexOf('/checkout-form/') > -1 || window.location.pathname.indexOf('/checkout/finish') > -1 || null;","trigger":"pageload"},{"name":"discount_activated","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.utils.getNestedProp('localStorage.StoredCouponCode', '').length > 0;","trigger":"pageload"},{"name":"total_discount","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var event_arr = window.dataLayer.filter(function(e) {return (e.event === 'gaEventTrigger' && (e.gaEventAction === 'show' || e.gaEventAction === 'visible') && e.gaEventCategory === 'VoucherNotification') || (e.event === 'gaEventTrigger_EE' && e.gaEventAction === 'promoView')});\n if (event_arr.length > 0) {\n \tvar data = bouncex.utils.getNestedProp('data', null, event_arr[0]);\n \tif (!data) return false;\n \tvar discount = data.totalDiscount.replace(/[^0-9\\.]/g, '');\n \treturn discount;\n }\n return null;\n})();","trigger":"pageload"},{"name":"total_discount_dupe","polling":"all","persist":"visit","page_types":[],"testmode":true,"default":"false","code":"(function() {\n var event_arr = window.dataLayer.filter(function(e) {return (e.event === 'gaEventTrigger' && (e.gaEventAction === 'show' || e.gaEventAction === 'visible') && e.gaEventCategory === 'VoucherNotification') || (e.event === 'gaEventTrigger_EE' && e.gaEventAction === 'promoView') || (e.event === 'donotTrack' && e.gaEventAction === 'promoView')});\n if (event_arr.length > 0) {\n \tvar data = bouncex.utils.getNestedProp('data', null, event_arr[0]);\n \tif (!data) return false;\n \tvar discount = data.totalDiscount.replace(/[^0-9\\.]/g, '');\n \treturn discount;\n }\n return null;\n})();","trigger":"pageload"},{"name":"coupon_code","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var event_arr = window.dataLayer.filter(function(e) {return (e.event === 'gaEventTrigger' && (e.gaEventAction === 'show' || e.gaEventAction === 'visible') && e.gaEventCategory === 'VoucherNotification') || (e.event === 'gaEventTrigger_EE' && e.gaEventAction === 'promoView')});\n if (event_arr.length > 0) {\n \tvar data = bouncex.utils.getNestedProp('data', null, event_arr[0]);\n \tif (!data) return false;\n \treturn data.code;\n }\n return null;\n})();","trigger":"pageload"},{"name":"tracked_coupon","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"seasonal_sku","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function(){\n var params = bouncex.utils.url.queryStringToObject(window.location.search);\n if (params.sku) {\n return params.sku[params.sku.length - 1] === '1';\n } else if (bouncex.website.pts === 'checkout') {\n return null;\n }\n return false;\n})();","trigger":"pageload"},{"name":"plan_name","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"sku","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function(){\n\tvar currentUrl = window.location.href;\n\t\n\tif (bouncex.website.pts === 'checkout' || (currentUrl.indexOf('/register') > -1 && currentUrl.indexOf('checkout-form') > -1) || currentUrl.indexOf('/plans') > -1) {\n var clickEvents = dataLayer.filter(function(event){\n return event.ecommerce && event.gaEventLabel;\n });\n var cartEvents = dataLayer.filter(function(event){\n return event.cart && event.cart.products && event.cart.products.length > 0;\n });\n\n if (clickEvents.length > 0) {\n return clickEvents[0].gaEventLabel.split('|')[0];\n } else if (cartEvents.length > 0) {\n return cartEvents[0].cart.products[0].sku;\n }\n }\n\treturn null;\n})();","trigger":"pageload"},{"name":"cancelled_member","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n for (let d in dataLayer){\n if (dataLayer[d].hasActiveSubscription === false) {\n return dataLayer[d].hasActiveSubscription === false && dataLayer[d].hasInactiveSubscription === true;\n }\n } \n})();","trigger":"pageload"},{"name":"active_member","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n for (let d in dataLayer){\n if(dataLayer[d].hasActiveSubscription){\n return dataLayer[d].hasActiveSubscription === true && dataLayer[d].hasInactiveSubscription === true;\n }\n } \n})();","trigger":"pageload"},{"name":"active_member_dupe","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"(function(){\n for (let d in dataLayer){\n if(dataLayer[d].hasActiveSubscription){\n return dataLayer[d].hasActiveSubscription === true && dataLayer[d].hasInactiveSubscription === true;\n }\n } \n})();","trigger":"pageload"},{"name":"cart_exists","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"document.cookie.indexOf('hf_cart_id') > -1;","trigger":"pageload"},{"name":"lp","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"document.referrer.indexOf('.hellofresh.com') > -1 || bouncex.cookie.vpv > 1 ? null : window.location.href;","trigger":"pageload"},{"name":"discount_message","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n\tvar event_arr = window.dataLayer.filter(function(e) {\n\t return (e.event === 'gaEventTrigger' && (e.gaEventAction === 'show' || e.gaEventAction === 'visible') && e.gaEventCategory === 'VoucherNotification') || (e.event === 'gaEventTrigger_EE' && e.gaEventAction === 'promoView') || (e.event === 'donotTrack' && e.gaEventAction === 'promoView');\n\t});\n\n\tif (event_arr.length > 0) {\n\t\tvar data = bouncex.utils.getNestedProp('data', null, event_arr[0]),\n\t\t\tdiscount = !!data && !!data.message ? data.message : '';\n\n\t\treturn discount.replace('
', '').replace('’', \"'\").trim() || false;\n\t}\n\treturn null;\n})();","trigger":"pageload"},{"name":"bx_trigger_external_action","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"sms_opt_in","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"upgradedoffer_reactivated","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var index = 0;\n var newCoupon;\n var currentCoupon;\n \n if (!dataLayer) {\n return false;\n }\n for (index; index < dataLayer.length; index++) {\n if (dataLayer[index].event === 'wunderkindUpgradeOffer' && bouncex.utils.getNestedProp('data.amount', '', dataLayer[index])) {\n newCoupon = true;\n } \n if (dataLayer[index].event === 'donotTrack' ) {\n currentCoupon = true;\n }\n if (newCoupon && currentCoupon) {\n return true;\n } \n }\n})();","trigger":"pageload"},{"name":"novoucher_evergreen_offer","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"per_box","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n\tvar event_arr = window.dataLayer.filter(function(e) {\n\t\treturn (e.event === 'gaEventTrigger' && (e.gaEventAction === 'show' || e.gaEventAction === 'visible') && e.gaEventCategory === 'VoucherNotification') || (e.event === 'gaEventTrigger_EE' && e.gaEventAction === 'promoView') || (e.event === 'donotTrack' && e.gaEventAction === 'promoView')\n\t});\n\n\tif (event_arr.length > 0) {\n\t\tvar data = bouncex.utils.getNestedProp('data', null, event_arr[0]);\n\n\t\treturn !!data && !!data.amount ? data.amount : false;\n\t}\n\n\treturn null;\n})();","trigger":"pageload"},{"name":"number_of_boxes","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n\tvar event_arr = window.dataLayer.filter(function(e) {\n\t\treturn (e.event === 'gaEventTrigger' && (e.gaEventAction === 'show' || e.gaEventAction === 'visible') && e.gaEventCategory === 'VoucherNotification') || (e.event === 'gaEventTrigger_EE' && e.gaEventAction === 'promoView') || (e.event === 'donotTrack' && e.gaEventAction === 'promoView')\n\t});\n\n\tif (event_arr.length > 0) {\n\t\tvar data = bouncex.utils.getNestedProp('data', null, event_arr[0]);\n\t\t\n\t\treturn !!data && !!data.totalBoxes ? data.totalBoxes : false;\n\t}\n\n\treturn null;\n})();","trigger":"pageload"},{"name":"testing","polling":"all","persist":"no","page_types":[],"testmode":true,"default":"false","code":"localStorage.StoredCouponCode && localStorage.StoredCouponCode.length > 0;","trigger":"pageload"},{"name":"logged_in_identified","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","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":null,"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":"/*** https://www.wrike.com/open.htm?id=545075240 ***/\nvar skipDestroyAd = function(ca_id) {\n var excludedIds = ['1696016', '1703684', '1696043', '1696033'];\n if (excludedIds.indexOf(ca_id) > -1) {\n return true;\n }\n\treturn bouncex.campaigns[ca_id].ga_i.label.indexOf('Continuity - ') === 0 && bouncex.campaigns[ca_id].type === 'nanobar';\n};\n// var customTearDown = function() {\n// // clear campaigns\n// if (bouncex.campaigns) {\n// for (var ca_id in bouncex.campaigns) {\n// if (bouncex.campaigns.hasOwnProperty(ca_id) && !skipDestroyAd(ca_id)) {\n// bouncex.destroy_ad(ca_id);\n// }\n// }\n// }\n// // clear tasks and variables\n// CustomVariables.clearAll();\n// BxInterval.clearTasks();\n// };\n\nbouncex.tearDown = function() {\n // clear campaigns\n if (bouncex.campaigns) {\n for (var ca_id in bouncex.campaigns) {\n if (bouncex.campaigns.hasOwnProperty(ca_id) && !skipDestroyAd(ca_id)) {\n bouncex.destroy_ad(ca_id);\n }\n }\n }\n // clear tasks and variables\n CustomVariables.clearAll();\n BxInterval.clearTasks();\n};\n\n// SinglePageApp.dynamicPageChange = function(){ \n// bouncex.log('%c ~ !!!CUSTOM!!! spa new page ~', 'color: #000FFF');\n// //Not monkey patching InitSequence.dynamic.tearDown() because it's also used in destroyAll\n// //customTearDown will do the same thing ^^, but check if certain campaigns should get skipped\n// customTearDown();\n// bouncex.state.newvid = false;\n// InitSequence.dynamic.startUp();\n// bouncex.reload_campaigns('spa new page');\n// }; \n\n// Moved from CustomJS because it's now being used in event tracking\nbouncex.infoStore = {\n sessionStorageIdentifier: 'bxInfoStore',\n set: function(data) {\n var hashedData = bouncex.lz.compressToURI(JSON.stringify(data));\n try {\n sessionStorage.setItem(this.sessionStorageIdentifier, hashedData);\n } catch(e) {\n bouncex.err('session storage failure');\n }\n },\n \n get: function() {\n var info = sessionStorage.getItem(this.sessionStorageIdentifier);\n return info ? JSON.parse(bouncex.lz.decompressFromURI(info)) : '';\n },\n \n infoIsStored: function() {\n return !!sessionStorage.getItem(this.sessionStorageIdentifier);\n },\n \n populateFields: function(fields) {\n if (!this.infoIsStored()) return;\n \n var data = this.get();\n for (var field in fields) {\n if (fields.hasOwnProperty(field)) {\n fields[field].val(data[field]);\n }\n }\n }\n};\n","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 HelloFresh mktg txts (like cart reminders) to this #, per terms.","eventSharing":true,"shqId":"rh8z44s117-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":"","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":"0109586821763416266dd874f087ef69","creativesBaseStyles":"a53944a2","inbox":"749c9ccd613f1a40075d1e7b59caea42","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_f63930b37a25405c0fe14c50976210bb.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(); }})();