(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":1593,"name":"Diet-to-Go","cookie_name":"bounceClientVisit1593","domain":"diettogo.com","ct":"bind_to_domain","ally":0,"ei":1,"tcjs":"","cjs":"// BZ: Store user's zip code on submission of native zip code form - used in conjunction with zip code populator campaigns\nif (window.location.href.indexOf('pricing')>-1 && !bouncex.vars.zipcode_stored) {\n jQuery('#checkout_form').on('ajaxComplete', function() {\n if (jQuery('[name=zip]').length) {\n var zipcode = jQuery('[name=zip]').val();\n bouncex.setv('zipcode_stored', zipcode);\n bouncex.setBounceCookie();\n }\n });\n}\n\n/* enable.feature.COMPLIANCE_REFACTOR_ENABLED */","force_https":false,"waypoints":false,"content_width":0,"gai":"UA-6395119-2","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":[{"prop":"contains","val":"mydiettogo"},{"prop":"contains","val":"friend-referral"},{"prop":"contains","val":"support-request"},{"prop":"contains","val":"success-stories/share"},{"prop":"contains","val":"labor-day-special-offer-2016"},{"prop":"contains","val":"password-assistance"},{"prop":"contains","val":"redeem-invitation"},{"prop":"contains","val":"diettogo.com/portal-registration"},{"prop":"contains","val":"/restart-plan"},{"prop":"contains","val":"/stop-restart-plan"},{"prop":"contains","val":"/update-plan"}],"ple":false,"fbe":false,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"function viewPlan(plan) {\n bouncex.push(['view item', {\n 'item:id': plan\n }])\n}\n\nfunction replenish(cart) {\n bouncex.utils.cookies.create({\n name: CART_COOKIE_NAME,\n value: cart.token\n });\n\n window.location.href = window.location.pathname + '?bx_replen=true'\n}\n\nvar hostname = \"https://diettogo.com\"\nvar validDomain = window.location.href.indexOf(hostname) > - 1\n\nif (validDomain) {\n\tvar DIET_ANALYSIS_PATH = '/free-diet-analysis-results'\n\tvar PRICING_PATH = '/pricing'\n\n\tvar DELIVERY_PATH = '/delivery'\n\tvar PLANS_PATH = '/plans'\n\tvar SHIPPING_PATH = '/shipping-information'\n\tvar CHECKOUT_PATH = '/checkout'\n\n\tvar CART_COOKIE_NAME = 'dtg_choices'\n\n\tvar CART_ABDANONDMENT_PATHS = [\n\t DELIVERY_PATH,\n\t PLANS_PATH,\n\t SHIPPING_PATH,\n\t CHECKOUT_PATH\n\t]\n\n\tvar itemImageUrl = 'https://assets.bounceexchange.com/assets/uploads/users/1179/47f2f280a4dd7af8274a2565c1254553.png'\n\n\tvar isDietAnalysisPage = window.location.pathname.indexOf(DIET_ANALYSIS_PATH) > -1;\n\tvar isPricingPage = window.location.pathname.indexOf(PRICING_PATH) > -1;\n\tvar isCartAbandonmentPage = CART_ABDANONDMENT_PATHS.indexOf(window.location.pathname) > -1;\n\n\tbouncex.et.cart.init({\n\t replenishmentType: 'cookie',\n\t replenish: replenish\n\t});\n\n\tif (isDietAnalysisPage) {\n\t var plan = jQuery('#fda_results .left-container p a').text();\n\t var url = window.location.origin + window.location.pathname\n\t viewPlan(plan);\n\t bouncex.push(['item', {\n\t 'item:id': plan,\n\t 'item:url': url,\n\t 'item:copy': plan,\n\t 'item:imageurl': itemImageUrl\n\t }]);\n\t}\n\n\tif (isPricingPage) {\n\t bouncex.push(['view incentivized']);\n\t}\n\n\tif (isCartAbandonmentPage) {\n\t var token = getBounceCookie('dtg_choices')\n\t bouncex.push(['add to cart', {\n\t 'cart:token': token\n\t }]);\n\t}\n}\n","dge":false,"bxidLoadFirst":false,"pie":false,"cme":false,"gbi_enabled":0,"bpush":false,"pt":null,"els":null,"vars":[{"name":"meal_in_cart","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":0,"code":"(function(){\n\tif (document.location.href.indexOf('shipping-fhd') > -1) {\n\t\tif (jQuery('#plan_info:contains(Balance-D)').length > 0) {\n\t\t\treturn 'Balance-D';\n\t\t} else if (jQuery('#plan_info:contains(Balance)').length > 0) {\n\t\t\treturn 'Balance';\n\t\t} else if (jQuery('#plan_info:contains(Carb30)').length > 0) {\n\t\t\treturn 'Carb30';\n\t\t}\n\t}\n})();","trigger":""},{"name":"fresh_pickup","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n if (jQuery('#order-summary .row h4').length > 0) {\n return jQuery('#order-summary .row h4').text().toLowerCase().indexOf('pickup') > -1;\n }\n return null;\n})();","trigger":""},{"name":"home_delivery","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n if (jQuery('#order-summary .row h4').length > 0) {\n return jQuery('#order-summary .row h4').text().toLowerCase().indexOf('delivery') > -1;\n }\n return null;\n})();","trigger":""},{"name":"zipcode_stored","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"name_stored","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"bmi_stored","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(function(){\n if ( location.pathname.indexOf('free-diet-analysis-results') > -1 && jQuery('#bmi_number').length ) {\n \tvar bmi = +jQuery('#bmi_number').text().match(/\\d+/)[0];\n \tif ( bmi > 0 ) {\n \t\treturn bmi;\n \t} else {\n \t\treturn null;\n \t}\n } else {\n \treturn null;\n }\n}());","trigger":""},{"name":"weeks_remaining","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(function(){\n if ( location.pathname.indexOf('free-diet-analysis-results') > -1 && jQuery('#calorie_intake:not([style=\"display: none\"])').length ) {\n var weeks = +jQuery('tr:not([style=\"display: none\"])').eq(1).find('.content.last').text().split(' ')[0];\n if ( weeks ) {\n \treturn weeks;\n } else {\n \treturn null;\n }\n } else {\n \treturn null;\n }\n}());","trigger":""},{"name":"calories_per_day","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(function(){\n if ( location.pathname.indexOf('free-diet-analysis-results') > -1 && jQuery('#calorie_intake:not([style=\"display: none\"])').length ) {\n \tvar $firstRow = jQuery('tr:not([style=\"display: none\"])').eq(1);\n var weeks = +$firstRow.find('.content.last').text().split(' ')[0];\n //KK: checking weeks ensures an actual plan is being provided / no negative or super low numbers\n if ( weeks ) {\n return $firstRow.find('.first .content').text().split(' ')[0];\n }\n } else {\n \treturn null;\n }\n}());","trigger":""},{"name":"ibx_test","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"location.href.indexOf('ibx_test') > -1 || null;","trigger":""},{"name":"email_stored","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"pricing_page","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"window.location.pathname.indexOf('/pricing') > -1;","trigger":"pageload"},{"name":"delivery_page","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"window.location.pathname.indexOf('/delivery') > -1;","trigger":"pageload"},{"name":"push_eligible_page","polling":"vars","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n\n var lowIntentPaths = [\n '/delivery',\n '/plans',\n '/shipping-information',\n '/checkout'\n ]\n\n var highIntentPaths = [\n '/',\n '/pricing',\n '/how-it-works',\n 'meal-plans',\n 'local-pickup',\n 'guarantee'\n ]\n\n var allPaths = lowIntentPaths.concat(highIntentPaths)\n return allPaths.indexOf(window.location.pathname) > -1\n\n})();","trigger":"pageload"},{"name":"high_intent_page","polling":"vars","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n\n var highIntentPaths = [\n '/delivery/',\n '/plans/',\n '/shipping-information/',\n '/checkout?winback=e'\n ]\n\n return highIntentPaths.indexOf(window.location.pathname) > -1\n\n})();\n","trigger":"pageload"},{"name":"low_intent_page","polling":"vars","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n\n var lowIntentPaths = [\n '/',\n '/pricing/',\n '/how-it-works/',\n '/meal-plans/',\n '/local-pickup/',\n '/guarantee/'\n ]\n\n return lowIntentPaths.indexOf(window.location.pathname) > -1\n\n})();","trigger":"pageload"},{"name":"cart","polling":"none","persist":"visit","page_types":[],"testmode":true,"default":"false","code":"null;","trigger":"pageload"},{"name":"using_edge_browser","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.browser.edge","trigger":"pageload"},{"name":"logged_in","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n if (window.location.href.indexOf('/menu-management') > -1 || window.location.href.indexOf('/mobile-web-menu-manager') > -1) {\n return jQuery('#zph_customer, section#menu_manager').length > 0;\n } else if (window.location.href.indexOf('log_in') > -1 || window.location.href.indexOf('log-in') > -1 || window.location.href.indexOf('login') > -1) {\n return jQuery('form.login, div#login').length === 0;\n }\n return null;\n})();","trigger":"pageload"},{"name":"submitted_onsite","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"jQuery('#bottom-analysis .thanks').is(':visible') || null;","trigger":"pageload"},{"name":"ever_logged_in","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in || 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":"bouncex.ibx.track('event','bouncex conversion');","miw":1,"mibcx":1,"te":1,"cart_rep":{"get":"","set":"// refill form\nvar ibxCart = decodeURIComponent(bouncex.ibx._getparam('ibx_cart'));\nif (ibxCart && window.location.href.indexOf('/pricing')) {\n var forms = ibxCart.split('&');\n for (var i = 0; i < forms.length; i++) {\n if (forms[i]){\n var form = forms[i].split('=');\n localStorage.setItem(form[0], decodeURIComponent(form[1]));\n }\n }\n window.location.href = '/pricing';\n}\n\n\n/*\nvar ibxCart = decodeURIComponent(bouncex.ibx._getparam('ibx_cart'));\n\nif (window.location.href.indexOf('/pricing') > -1 && ibxCart) {\n\n\tvar time = 365,\n dt = new Date();\n\tdt.setTime(dt.getTime() + time * 24 * 60 * 60 * 1e3);\n\tvar exp = dt.toGMTString();\n var splitIbxCart = ibxCart.split('|'),\n cleanIbxCart = splitIbxCart[0],\n zipCode = splitIbxCart[1],\n cartAbandonPath = splitIbxCart[2];\n\n\tdocument.cookie=\"dtg_choices=\" + cleanIbxCart + \";path=/;.diettogo.com;expires=\" + exp + \";dtg_choices=\" + cleanIbxCart + \";path=/;diettogo.com;expires=\" + exp + \";\";\n\tbouncex.setv('zipcode_stored', zipCode);\n\tbouncex.setBounceCookie();\n\n\tsetTimeout(function () {\n window.location.href = cartAbandonPath;\n\t}, 1000);\n\n}\n*/"},"ulpj":null,"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":"","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"","eventSharing":false,"shqId":"","enabled":1},"pde":false,"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":"","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":"f1562c682b41d65d1608e7f2508f6d9b","creativesBaseStyles":"a53944a2","gpsAuction":"0aafcb326e2e52aae2936349578031e7","inbox":"02aca5df0e176b8810a86da97ac05424","onsite":"0e56ab6ba004ee080ce3deb3edae35e9","sms":"e39203556bab2366e56296ce42e974a7","websdk":"437a9f1c542faaacb49577b266dc4d73"}; 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_8898b9bce26384554e87ba533505520e.br.js'); script.setAttribute('async', 'async'); document.body.appendChild(script); bouncex.initializeTag = function() {}; }; document.body.appendChild(runtime); } } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", bxBootstrap); } else { bxBootstrap(); }})();