(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":2808,"name":"SeaWorld | San Antonio","cookie_name":"bounceClientVisit2808","domain":"seaworld.comsan-antonio","ct":"bind_to_domain","ally":0,"ei":0,"tcjs":"","cjs":"/* https://www.wrike.com/open.htm?id=260401079 names GA tracker to match site */\nbouncex.report_ga = function(action,label,bypass){\n var trackerName = 't1';\n\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 = 'BounceX ' + action;\n }\n if(typeof window.ga === 'function') {\n if(bouncex.website.gai){\n window.ga('create', bouncex.website.gai, 'auto', trackerName);\n }\n window.ga(trackerName+'.send','event','BounceX',action,label,{'nonInteraction':interaction});\n } else if(typeof window._gaq === 'object') {\n if(bouncex.website.gai){\n window._gaq.push(['_setAccount', bouncex.website.gai]);\n }\n var strippedLabel = label.replace(/\\(|\\)/g, ''); // window._gaq encodes close paren as '1\n window._gaq.push([trackerName+'._trackEvent','BounceX',action,strippedLabel,,interaction]);\n }\n}; \n\n/*cookie management: https://www.wrike.com/open.htm?id=212915753*/\nfunction cleanBxCookies() {\n var cookies = document.cookie.split(';');\n var numCookies = cookies.length;\n for (var r = 0; r < numCookies; r++) {\n var i = cookies[r];\n while (i.charAt(0) == ' ') {\n i = i.substring(1, i.length);\n }\n if (i.indexOf('bounceClientVisit') === 0) {\n var name = i.split('=')[0];\n if (name.indexOf(bouncex.website.id) === -1) {\n deleteCookie(name);\n }\n }\n }\n}\nfunction deleteCookie(name) {\n var expiration = '; expires=Thu, 01 Jan 1970 00:00:01 GMT';\n document.cookie = (name + '=' + expiration + ';path=/;');\n document.cookie = (name + '=' + expiration + ';path=/;domain=.'+bouncex.cookie_domain+';');\n}\n\ncleanBxCookies();\n/*end cookie management*/","force_https":false,"waypoints":false,"content_width":0,"gai":"UA-6542687-1","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":"/* helpers */\n\nvar makePath = function (path) {\n return '/' + parkPrefix + path;\n};\n\nfunction checkPath(path) {\n\treturn [makePath(path)].indexOf(window.location.pathname) > -1; \n}\n\nfunction initializeUserTracking() {\n if (!bouncex.vars.logged_in || !!bouncex.vars.logged_in_identified) {\n return;\n }\n\n var userEmail;\n\n bouncex.et.onTrue(\n function () {\n userEmail = jQuery('.site-header__manage-account-email-address').first().text().trim();\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 5\n );\n}\n\n/* variables */\nvar onProductionSite = location.origin === 'https://seaworld.com';\nvar parkPrefix = 'san-antonio';\n\nvar multiTicketId = '8200601';\nvar multiTicketPathnames = ['/'+parkPrefix+'/tickets/multi-park-tickets/'];\nvar multiTicketPage = multiTicketPathnames.indexOf(location.pathname) > -1;\n\nvar annualTicketId = '8500638';\nvar annualTicketPathnames = ['/'+parkPrefix+'/annual-pass/'];\nvar annualTicketPage = annualTicketPathnames.indexOf(location.pathname) > -1;\n\nvar militaryTeacherTicketPathnames = ['/'+parkPrefix+'/tickets/military-discount/', '/'+parkPrefix+'/tickets/teacher-card/'];\nvar militaryTeacherTicketPage = new RegExp(militaryTeacherTicketPathnames.join('|')).test(location.pathname);\n\nvar singleTicketId = '8200446';\nvar singleTicketPathnames = [\n\t'/'+parkPrefix+'/tickets/single-park-tickets/', \n\t'/'+parkPrefix+'/tickets/', \n\t'/'+parkPrefix+'/tickets/preschool-free-admission/',\n\t'/'+parkPrefix+'/tickets/group-tickets/',\n\t'/'+parkPrefix+'/tickets/',\n\t'/'+parkPrefix+'/limited-time-offers/'\n];\n\nvar singleTicketPage = !isReservation() && !militaryTeacherTicketPage && !annualTicketPage && !multiTicketPage &&\n\t(singleTicketPathnames.indexOf(location.pathname) > -1 || window.location.pathname.indexOf('tickets') > -1);\n\nvar noNewLineRegex = /\\s+(.+)/;\n\nvar ticketPassPaths = [\n makePath('/tickets/'),\n makePath('/tickets/theme-park-tickets/'),\n makePath('/limited-time-offers/')\n];\nvar upgradePaths = [\n makePath('/upgrades/most-popular/'),\n makePath('/upgrades/quick-queue/'),\n makePath('/upgrades/dining/'),\n makePath('/upgrades/tours/'),\n makePath('/upgrades/')\n];\n\nvar annualPassPath = '/annual-pass';\nvar annualPassString = ' annual pass';\nvar isAnnualPassPage = window.location.pathname.indexOf(annualPassPath) > -1;\nvar isTicketPassPage = ticketPassPaths.indexOf(window.location.pathname) > -1 || window.location.pathname.indexOf('/tickets/') > -1;\nvar isPassPage = isAnnualPassPage || isTicketPassPage;\nvar isUpgradePage = upgradePaths.indexOf(window.location.pathname) > -1 || window.location.pathname.indexOf('tampa/educational-programs/') > -1;\n\nvar annualPassObj = {\n\titemGrid : '.two-tier-product-listing__product',\n\tgetId : function($itemEl) {\n\t\t\t\t\treturn $itemEl.find('[type=\"radio\"]').attr('id');\n\t\t\t\t},\n\tgetCopy : function($itemEl) {\n\t\t\t\t\tvar id = this.getId($itemEl);\n\t\t\t\t\treturn id ? id + annualPassString : '';\n\t\t\t\t},\n\tgetImage : function($itemEl){\n\t\t\t\t\treturn getImageUrl($itemEl, '.two-tier-product-listing__product-image');\n\t\t\t\t},\n\tgetPrice : function ($itemEl) {\n\t\t\t\t\treturn $itemEl.find('.product-price__price-term').first().text().replace(/[^0-9.]/g,'');\n\t}\n};\n\nvar nonAnnualPassObj = {\n\titemGrid : '.product-catalog-card',\n\tgetId : function($itemEl) {\n\t\t\t\t\treturn $itemEl.attr('data-selling-group-id');\n\t\t\t\t},\n\tgetCopy : function($itemEl) {\n\t\t\t\t\tvar match = $itemEl.find('.product-catalog-card__title').text().match(noNewLineRegex);\n\t\t\t\t\tif (match) { return match[1]; }\n\t\t\t\t},\n\tgetImage : function($itemEl) {\n\t\t\t\t\treturn getImageUrl($itemEl, '.product-catalog-card__image');\n\t\t\t\t},\n\tgetPrice : function($itemEl) {\n\t\t\t\t\treturn Number($itemEl.find('.product-price__price-amount').first().text().replace(/[^\\d.]/g,''));\n\t\t\t\t}\n };\n\nfunction getImageUrl($itemEl, selector) {\n\tvar paramUrl = $itemEl.find(selector).first().attr('src') || '',\n\t\tdomain = 'https://seaworld.com';\n\n\treturn paramUrl.indexOf(domain) > -1 ? paramUrl : domain + paramUrl;\n}\n\n/* ------------------------------ ITEM TRACKING ----------------------------- */\n\nfunction getItemFromElement(element, selectorsObj){\n\tvar $itemEl = jQuery(element);\n\tvar id = selectorsObj.getId($itemEl);\n\tvar copy = selectorsObj.getCopy($itemEl);\n\tvar imageUrl = selectorsObj.getImage($itemEl);\n\tvar price = selectorsObj.getPrice($itemEl);\n\tvar itemUrl = window.location.origin + window.location.pathname;\n\tvar category = window.location.pathname;\n\treturn {\n\t\tid : id,\n\t\tcopy : copy,\n\t\timageUrl : imageUrl,\n\t\titemUrl : itemUrl,\n\t\tcategory : category,\n\t\tprice : price\n\t};\n}\n\nfunction getItemId(){\n\tswitch (true) {\n\t\tcase window.location.pathname.indexOf('upgrades') > -1:\n\t\t\treturn 'upgrades';\n\t\tcase checkPath('tickets'):\n\t\t\treturn 'tickets';\n\t\tcase checkPath('tickets/fun-card'):\n\t\t\treturn 'fun-card';\n\t\tcase checkPath('annual-pass'):\n\t\t\treturn 'annual';\n\t\tcase checkPath('limited-time-offers'):\n\t\t\treturn 'limited';\n\t\tdefault:\n\t\t\treturn 'other';\n\t}\n}\n\nfunction trackItems() {\n var selectorsObj = isAnnualPassPage ? annualPassObj : nonAnnualPassObj;\n var selector = selectorsObj.itemGrid;\n var itemEls = jQuery(selector);\n if (itemEls.length) {\n var itemObjs = jQuery.map(itemEls, function(itemEl) { return getItemFromElement(itemEl, selectorsObj); });\n\n initializeATCClickTracking();\n\n jQuery.each(itemObjs, function(index, item) {\n fireItemEvent(item);\n });\n }\n}\n\nfunction fireItemEvent(item) {\n bouncex.push(['item', {\n 'item:id' : item.id,\n 'item:copy' : item.copy,\n 'item:imageurl' : item.imageUrl,\n 'item:price' : item.price,\n 'item:url' : item.itemUrl,\n 'item:category' : item.category,\n 'item:instock' : true\n }]);\n}\n\n/* ------------------------------- CART EVENTS ------------------------------ */\n\nfunction fireAddToCart(itemId) {\n bouncex.push(['add to cart', { 'item:id': itemId }]);\n\n if (bouncex.vars.cart) {\n return;\n }\n bouncex.setVar('cart', true);\n}\n\nfunction initializeATCClickTracking() {\n var itemId;\n\n bouncex.et.on(bouncex.document, 'click.bxatc', function () {\n itemId = jQuery(this).parents('.product-catalog-card__grouped-button-container').attr('data-selling-group-id')\n || (jQuery(this).parent('.two-tier-product-listing__place-order').find('.two-tier-product-listing__pass-group.two-tier-product-listing__selected-group').attr('data-product') || '').toLowerCase();\n\n if (itemId) {\n fireAddToCart(itemId);\n }\n }, '.product-catalog-card__order-button, .two-tier-product-listing__button');\n}\n\nfunction initializeCartEvents() {\n bouncex.et.cart.init({\n replenish: function () { },\n replenishmentType: 'single'\n });\n}\n\nfunction trackEmptyCart () {\n var emptiedCart = bouncex.vars.cart_qty === 0 && bouncex.vars.cart;\n var emptiedCartCheckoutPage = jQuery('.cart__empty-cart-msg:visible').length > 0;\n if ((emptiedCart || bouncex.vars.cart_qty > 0 && emptiedCartCheckoutPage) && !bouncex.utils.getParam('bx_cart').length) {\n bouncex.push(['empty_cart', {}]);\n bouncex.setv('cart', false);\n }\n}\n\n/* --------------------------- INITIALIZE TRACKING -------------------------- */\n\nfunction isReservation() {\n\treturn window.location.pathname.indexOf('tickets/reservations') > -1 ||\n\t\twindow.location.pathname.indexOf('checkout/validate') > -1;\n}\n\nif (onProductionSite && !militaryTeacherTicketPage){\n\tvar ignoreUpgradePages = ['/'+parkPrefix+'/upgrades/express-entry/', '/'+parkPrefix+'/upgrades/parking-and-rentals/', '/'+parkPrefix+'/upgrades/preschool-card/', '/'+parkPrefix+'/upgrades/photo-packages/'];\n\n\tif (location.pathname.indexOf('upgrades') > -1 && ignoreUpgradePages.indexOf(location.pathname) === -1){\n\t\tbouncex.push(['view category', {\n\t\t\t'page:url' : bouncex.utils.url.allowParams(),\n\t\t\t'page:title' : jQuery('.product-placement-container__title').first().text()\n\t\t}]);\n\t}\n\n initializeUserTracking();\n initializeCartEvents();\n\n bouncex.et.onVarChange('cart_qty', trackEmptyCart);\n\n if (bouncex.website.pts === 'cart' && !isReservation()) {\n trackEmptyCart();\n }\n\n\tif (singleTicketPage){\n\t\tbouncex.push(['view item', {\n\t\t\t'item:type' : 'single',\n\t\t\t'item:id' : singleTicketId,\n\t\t}]);\n\t}else if (multiTicketPage){\n\t\tbouncex.push(['view item', {\n\t\t\t'item:type' : 'multi',\n\t\t\t'item:id' : multiTicketId,\n\t\t}]);\n\t}else if (annualTicketPage){\n\t\tbouncex.push(['view item', {\n\t\t\t'item:type' : 'annual',\n\t\t\t'item:id' : annualTicketId,\n\t\t}]);\n\t}\n\n if (isPassPage || isUpgradePage) {\n trackItems();\n }\n}","dge":false,"bxidLoadFirst":false,"pie":false,"cme":false,"gbi_enabled":0,"bpush":false,"pt":null,"els":{"donation_box_checkout_page":"[for=\"donation5\"]","donation_form_container":"section.cart-donation"},"vars":[{"name":"cart_item_date_expired","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('.js-add-to-cart-date-dynamic,.cart__reservation-datetime .date,.js-add-to-cart-date').toArray().some(function(reservation){\n\tvar $reservationDate = jQuery(reservation),\n\texpirationDate = new Date($reservationDate.val() || $reservationDate.text());\n\texpirationDate.setDate(expirationDate.getDate() + 1);\n\tvar today = new Date();\n\treturn expirationDate < today;\n});","trigger":""},{"name":"cart_qty","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"(function () {\n\tvar minicartText = jQuery('.cart-preview__count,.cart-preview__header').first().text().trim().replace(/[^0-9.]/g, '');\n\tif (minicartText){\n\t\treturn +minicartText;\n\t}else if (jQuery('body').is('.cart-page')){\n\t\tif (jQuery('.cart__empty-cart-msg:visible').length > 0){\n\t\t\t/* if cart empty message on cart page return 0 */\n\t\t\treturn 0;\n\t\t}\n\t\tvar cartItemQtys = jQuery('.cart__quantity-field');\n\t\t/* if items add em up */\n\t\tif (cartItemQtys.length > 0){\n\t\t\tvar sum = 0;\n\t\t\tcartItemQtys.each(function(i, e){\n\t\t\t\tsum += +cartItemQtys.eq(i).val();\n\t\t\t});\n\t\t\treturn sum;\n\t\t}\n\n\t}else{\n\t\treturn null;\n\t}\n})();","trigger":""},{"name":"cart","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":""},{"name":"cart_value","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"jQuery('#cart-billing').length > 0 ? null : Number(jQuery('.cart-preview__line-item:contains(\"Subtotal\"),td.order-summary__detail').first().text().replace(/[^0-9.]/g, ''));","trigger":""},{"name":"discount_in_cart","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"(function () {\n var $orderSummarySavings = jQuery('.order-summary__detail--savings, .cart-preview--amount-saved:last');\n var $miniCartItems = jQuery('.cart-preview-item');\n \n if (jQuery('.cart__empty-cart-msg').is(':visible') || jQuery('.swpe-header__mini-cart-count').text() === '0' || jQuery('.cart-preview__count').hasClass('cart-preview__count--is-hidden')) {\n\t\treturn 0;\n }\n\n if ($miniCartItems.length > 0) {\n return Math.round($miniCartItems.toArray().reduce(function(total, item) {\n var $item = jQuery(item);\n var oldPrice = $item.find('.was-price').text().match(/\\d+.\\d+/);\n var newPrice = $item.find('.cart-preview-item__order-quantity:last').text().match(/\\d+.\\d+/);\n var quantity = $item.find('.cart-preview-item__order-name').text().match(/\\d+/);\n return total += oldPrice ? (oldPrice - newPrice) * quantity : 0;\n }, 0));\n }\n\n if ($orderSummarySavings.length > 0) {\n return Math.round($orderSummarySavings.text().replace(/[^0-9.]/g, ''));\n }\n\n return null;\n})();","trigger":""},{"name":"in_app","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"window.location.href.indexOf('utm_source=app&utm_medium=app') > -1;","trigger":""},{"name":"ibx_test","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"window.location.href.indexOf('ibx_test') > -1 ? true : null;","trigger":""},{"name":"category_title","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function () {\n if (window.location.pathname === '/san-antonio/') {\n return 'home';\n }\n var categoryTitle = jQuery('h1.page-banner__title, .page-headline.container, .swpe-page-banner h1').first().text().trim();\n if (categoryTitle) {\n return categoryTitle;\n }\n var categoryTitleFromBreadCrumb = jQuery('.swpe-breadcrumbs__text').last().text().trim();\n return categoryTitleFromBreadCrumb ? categoryTitleFromBreadCrumb : false;\n})();","trigger":""},{"name":"upsell_purchased","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"(function () {\n var upsell_items = [\n ];\n\n var ecommerce = bouncex.utils.gtmLookup('ecommerce');\n var products = ecommerce && ecommerce.purchase.products;\n\n if (products) {\n return products.some(function(purchased_item){\n return upsell_items.indexOf(purchased_item.id) > -1;\n });\n }\n\n return null;\n})();","trigger":"pageload"},{"name":"logged_in","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"bouncex.utils.getNestedProp('dataLayer[0].loggedIn') === \"yes\"","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":{"et_rid":"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":"","eventSharing":false,"shqId":"","enabled":0},"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":"326306042","ga4_measurement_id":"G-HJFK13YHJV","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":"316b12a95511cf618ef642592cd7c824","creativesBaseStyles":"a53944a2","gpsAuction":"bbb80866120d17013073bb6d284cbd6b","inbox":"02aca5df0e176b8810a86da97ac05424","onsite":"0e56ab6ba004ee080ce3deb3edae35e9","sms":"e39203556bab2366e56296ce42e974a7","websdk":"fb3da6ba1a7a78e95cf94d2dc9e22138"}; 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_cbe64330162f40129adcc52cb7219c2e.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(); }})();