(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":4604,"name":"K9 Ballistics","cookie_name":"bounceClientVisit4604","domain":"k9ballistics.com","ct":"fp_local_storage","ally":0,"ei":0,"tcjs":"","cjs":"/* --------------------------- INITIALIZE SHOPIFY DYNAMIC COUPON AUTOAPPLY -------------------------- */\nfunction initShopifyCouponAutoApply() {\n var isShopifyHostedTheme = !!bouncex.utils.getNestedProp('Shopify.theme.id');\n\n if (isShopifyHostedTheme) {\n bouncex.off(bouncex.window, 'bxCouponFetched.bx-cpn-auto-apply');\n bouncex.on(bouncex.window, 'bxCouponFetched.bx-cpn-auto-apply', function(event, params) {\n if (params.code !== bouncex.vars.coupon_auto_applied) {\n ajaxShopifyAutoApply(params.code);\n }\n });\n }\n}\n\nfunction ajaxShopifyAutoApply(discount) {\n var updateJSON = JSON.stringify({\n 'discounts': [discount],\n }),\n errorMessage = 'event tracking: error with shopify coupon auto-apply',\n discountUrl = '/discount/'+discount,\n updateUrl = '/cart/update.js';\n\n jQuery.ajax({\n url: discountUrl,\n method: 'GET',\n })\n .then(function(){\n jQuery.ajax({\n url: updateUrl,\n method: 'POST',\n contentType: 'application/json',\n data: updateJSON,\n })\n .then(function(){ updateCouponVar(discount); }, function(){ bouncex.log(errorMessage + ' POST ' + updateUrl); });\n }, function(){ bouncex.log(errorMessage + 'GET '+ discountUrl); });\n}\n\nfunction updateCouponVar(discount) {\n bouncex.setVar('coupon_auto_applied', discount);\n}\n\n\ninitShopifyCouponAutoApply();\n\n/* enable.feature.TCF_ENABLE_NEW_PURPOSE_LIST */","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,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"var COOKIE = 'cart',\n K9BALLISTICS_DOMAIN = 'k9ballistics.com',\n EXCLUDED_ITEM_IDS = ['tough-3-5-bolster-orthopedic-dog-bed'];\n\n// ---- HELPERS ---- //\n\nfunction getUrl() {\n return bouncex.utils.url.allowParams();\n}\n\nfunction setVarAndCookie(varName, value) {\n bouncex.setVar(varName, value);\n bouncex.setBounceCookie();\n}\n\n// ---- ITEM META DATA ---- //\n\nfunction isExcluded(id, url) {\n return EXCLUDED_ITEM_IDS.indexOf(id) > -1 || url.indexOf('gift-card') > -1;\n}\n\nfunction getImageUrl() {\n var imgVariations = jQuery('[data-product-featured-image]').first().attr('data-bgset') || '',\n lastImgUrl = imgVariations.split(',').pop().split(' ')[1];\n if ( (new RegExp('^//')).test(lastImgUrl) ) {\n return 'https:' + lastImgUrl;\n }\n return lastImgUrl;\n}\n\nfunction normalizeItemId(itemId){\n return decodeURIComponent(itemId).replace(/[^a-zA-Z0-9-]/g, '');\n}\n\nfunction getItemIdFromUrl(url){\n return normalizeItemId(url.split('/').pop());\n}\n\nfunction roundStars(starNum) {\n return (Math.floor(starNum*2)/2).toFixed(1);\n}\n\nfunction getCoreFeatures() {\n if (jQuery('.faq-accordion:first').text() !== 'Core Features') {\n return [];\n }\n\n var $coreFeaturesParent = jQuery('.faq-accordion:first').next(),\n $coreFeaturesBullets = $coreFeaturesParent.length ? $coreFeaturesParent.find('li') : [],\n coreFeatures = [];\n\n for (var i = 0; i < $coreFeaturesBullets.length; i++) {\n coreFeatures.push($coreFeaturesBullets.eq(i).text().trim());\n }\n\n return coreFeatures;\n}\n\nfunction getItem() {\n var starNum = jQuery('.star-clickable .sr-only').text().split(' ').shift(),\n url = getUrl(),\n id = getItemIdFromUrl(url),\n item = {\n id : id,\n copy: bouncex.utils.getNestedProp('item.Name', ''),\n category : jQuery('.breadcrumb a').last().text(),\n url : url,\n imageurl : getImageUrl(),\n instock : jQuery('.product-form-cart-submit:enabled').length > 0 || bouncex.vars.in_stock,\n stars: starNum,\n rounded_stars: roundStars(starNum),\n reviews: (jQuery('.star-clickable .text-m').attr('aria-label') || '').split(' ')[0],\n coreFeatures: getCoreFeatures(),\n excluded: isExcluded(id, url)\n };\n return item;\n}\n\nfunction viewItem(itemId){\n bouncex.push(['view item', {\n 'item:id': itemId,\n 'item:itemgroupid': bouncex.utils.getNestedProp('item.ProductID')\n }]);\n}\n\n// ---- CATEGORY META DATA ---- //\n\nfunction getCategoryIds(){\n return jQuery('.product-item--link').map(function () {\n var itemUrl = jQuery(this).attr('href') || '',\n itemRawUrl = itemUrl.split('?')[0],\n itemId = getItemIdFromUrl(itemRawUrl);\n if (itemId) {\n return itemId;\n }\n }).toArray().join(',');\n}\n\nfunction getCollectionBenefits() {\n var $collectionBenefits = jQuery('.collection-benefit'),\n collectionBenefits = [];\n\n for (var i = 0; i < $collectionBenefits.length; i++) {\n collectionBenefits.push($collectionBenefits.eq(i).text().trim());\n }\n\n return collectionBenefits;\n}\n\nfunction getCategoryObj(){\n return {\n 'page:title' : jQuery('[data-collection-title]').first().text().trim(),\n 'page:url': getUrl(),\n 'items:ids': getCategoryIds(),\n 'page:core_features': getCollectionBenefits()\n };\n}\n\n// ---- CART TRACKING ---- //\n\n// Click ATC\nfunction addToCart(){\n bouncex.et.on(jQuery(document), 'click.bx', function(){\n var itemId = getItemIdFromUrl(getUrl()),\n cookie;\n bouncex.et.onTrue(function(){\n cookie = bouncex.getBounceCookie(COOKIE);\n return cookie;\n }, function(){\n bouncex.push(['add to cart',{\n 'item:id': itemId,\n 'cart:token': cookie\n }]);\n });\n setVarAndCookie('cart_set', true);\n }, '[data-submit-button]');\n}\n\n// ---- CATALOG ---- //\n\nfunction trackSku(itemId){\n var skuSelector = '[data-product-option-position]';\n bouncex.et.on(jQuery(document), 'click.bx', function(){\n bouncex.setTimeout2(function(){\n var sku = jQuery('#hs_current_variant_load').val(),\n groupId;\n if(bouncex.vars.prev_sku.toString() !== sku){\n bouncex.push(['select_sku', {\n 'item:id': itemId,\n 'item:itemgroupid': bouncex.utils.getNestedProp('item.ProductID'),\n 'item:feedid': sku\n }]);\n setVarAndCookie('prev_sku', sku);\n }\n }, 150);\n }, skuSelector);\n}\n\n// ---- INITIALIZE EVENTS ---- //\n\nfunction initializeItemEvents(){\n var item;\n bouncex.et.onTrue(function(){\n item = getItem();\n return !!item.id &&\n !!item.copy &&\n !!item.category &&\n !!item.url &&\n !!item.imageurl;\n }, function(){\n bouncex.push(['item', item]);\n viewItem(item.id);\n trackSku(item.id);\n }, 10);\n}\n\nfunction initializeCategoryEvents(){\n var categoryObj = getCategoryObj();\n if (categoryObj['items:ids'].length){\n bouncex.push(['view category', categoryObj]);\n }\n}\n\nfunction initializeLoggedInUser(){\n if (bouncex.vars.logged_in && bouncex.vars.logged_in_identified === false){\n var userEmail = bouncex.utils.getNestedProp('adroll_email', '');\n if (bouncex.utils.validate.email(userEmail)){\n bouncex.push([\n 'user',\n {\n 'email': userEmail,\n 'source': 'LoggedIn'\n }\n ]);\n setVarAndCookie('logged_in_identified', true);\n }\n }\n}\n\nfunction initializeCart(){\n bouncex.et.cart.init({\n replenishmentType : 'cookie',\n replenish : replenish,\n });\n addToCart();\n bouncex.et.onVarChange('cart_qty', emptyCart);\n bouncex.setTimeout2(emptyCart, 1500); // For when a user removes an item outside of a product page and the cart_qty doesn't update\n}\n\n// Cookie Replen\nfunction replenish(cart){\n bouncex.utils.cookies.create({'name': COOKIE, 'value': cart.token});\n window.location.href = window.location.pathname + '?bx_replen=true';\n}\n\nfunction emptyCart(){\n if (bouncex.vars.cart_set && bouncex.vars.cart_qty === 0){\n bouncex.push(['empty_cart']);\n setVarAndCookie('cart_set', false);\n }\n}\n\nfunction init(){\n var url = getUrl();\n if (url.indexOf(K9BALLISTICS_DOMAIN) > -1 && url.indexOf('gift-card') === -1 && url.indexOf('/clearance') === -1) {\n initializeLoggedInUser();\n initializeCart();\n switch (bouncex.website.pts) {\n case 'product':\n initializeItemEvents();\n break;\n case 'category':\n initializeCategoryEvents();\n break;\n default:\n break;\n }\n }\n}\n\ninit();","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":"/cart"}]]},"category":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"bouncex.utils.getNestedProp('ShopifyAnalytics.meta.page.pageType') === 'collection';"}]]},"checkout":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/checkouts"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"thank_you"}]]},"home":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"bouncex.utils.getNestedProp('ShopifyAnalytics.meta.page.pageType') === 'home';"}]]},"product":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"bouncex.utils.getNestedProp('ShopifyAnalytics.meta.page.pageType') === 'product';"}]]},"search":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"search?q"}]]}},"els":{"blank_site_element":""},"vars":[{"name":"logged_in","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n if (bouncex.website.pts === 'checkout') {\n if (jQuery('.breadcrumb__item--current').text().trim() === 'Information') {\n return jQuery('.logged-in-customer-information:visible').length > 0;\n }\n return null;\n }\n return !!bouncex.utils.getNestedProp('ShopifyAnalytics.meta.page.customerId');\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":"no","page_types":[],"testmode":false,"default":"0","code":"(function () {\n if (bouncex.website.pts === 'checkout' ) {\n var qty = 0;\n jQuery(\".product .product__quantity\").each(function (index) {\n qty += Number(jQuery(this).text().trim());\n });\n return qty;\n }\n\n return Number(jQuery('.hs-count-products-cart').text().replace(/[^0-9.]/g, '')) || Number(jQuery('.header__cart-icon__count').text());\n})();","trigger":""},{"name":"cart_value","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"0","code":"(function () {\n if (bouncex.website.pts === 'checkout') {\n return jQuery('.total-line__price .order-summary__emphasis').first().text().replace(/[^0-9.]/g, '');\n }\n return Number(jQuery('.hs-sub-total-cart').text().replace(/[^0-9.]/g, '')) || Number(jQuery('.cart__subtotal').text().replace(/[^0-9.]/g, ''));\n})();","trigger":""},{"name":"prod_price","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('.product-price').text().replace(/[^0-9.]/g, '');","trigger":""},{"name":"prod_name","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('.product-title').text();","trigger":""},{"name":"in_stock","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('.product-form-cart-submit:enabled').length > 0;","trigger":""},{"name":"submitted_onsite","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"jQuery('.ql-editor').text().indexOf('Thanks for subscribing!') > -1 || 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":"prev_sku","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"cart_set","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"logged_in_identified","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"coupon_auto_applied","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":0,"mibcx":1,"te":1,"cart_rep":{"get":"","set":""},"ulpj":{"bxid":"espemailid"},"cus":"","miw_exclude":"","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":0,"spatm":1,"preinit_cjs":"","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 K9 Ballistics mktg txts (like cart reminders) to this #, per terms.","eventSharing":false,"shqId":"","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":"358384151","ga4_measurement_id":"G-46M3N3ZPDT","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":"07b86cd800c4a4f31f957b17ec5e440e","creativesBaseStyles":"a53944a2","gpsAuction":"da7f2123bbe2e5d4e3b41dcea412be5c","inbox":"02aca5df0e176b8810a86da97ac05424","onsite":"0e56ab6ba004ee080ce3deb3edae35e9","sms":"e39203556bab2366e56296ce42e974a7","websdk":"9bfb4101582921c2f3bc6525926ca102"}; 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_533d031a0a5ca2c9d24e6369b88e2862.br.js'); script.setAttribute('async', 'async'); document.body.appendChild(script); var deviceGraphScript = document.createElement('script'); deviceGraphScript.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/cjs_min_3a843477d8e318f67237a66d0a58c542.js'); deviceGraphScript.setAttribute('async', 'async'); var dgAttrs = [{"Key":"id","Value":"c.js"},{"Key":"async","Value":"true"},{"Key":"data-apikey","Value":"2^HIykD"},{"Key":"data-cb","Value":"bouncex.dg.initPostDeviceGraph"},{"Key":"data-bx","Value":"1"},{"Key":"data-gm","Value":"1"},{"Key":"data-fire","Value":"1"}]; if (dgAttrs) { for (var i = 0; i < dgAttrs.length; i++) { deviceGraphScript.setAttribute(dgAttrs[i].Key, dgAttrs[i].Value); } } document.body.appendChild(deviceGraphScript); bouncex.initializeTag = function() {}; }; document.body.appendChild(runtime); } } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", bxBootstrap); } else { bxBootstrap(); }})();