}); //Search platform form action function searchSubmit(e) { e.preventDefault(); sParameter = searchForm.search.value; sParameter = encodeURIComponent(sParameter.trim()); sURL = searchForm.action + '?query=' + sParameter; window.location = sURL; //GA event for search dataLayer.push({ 'event': 'eventTracker', 'eventCat':'site search', 'eventAct':'search box', 'eventLbl':'explore our content', 'eventVal':0, 'nonInteraction': 0, }); } const searchForm = document.getElementById('js-searchForm'); searchForm.addEventListener('submit', searchSubmit); //Search button action function showNavSearch(e) { $('.menuList-item-search').addClass('overlay'); $('.menuList-item-search input#search').focus(); } const searchButton = document.getElementById('js-searchButton'); searchButton.addEventListener('click', showNavSearch); //Close search button action function hideNavSearch(e) { $('.menuList-item-search').removeClass('overlay'); } const searchCloseButton = document.getElementById('js-searchCloseButton'); searchCloseButton.addEventListener('click', hideNavSearch); //"Try Now" nav button tracking $('#nav-tryNow').on('click', function() { dataLayer.push({ 'event': 'eventTracker', 'eventCat':'marketing', 'eventAct':'nav', 'eventLbl':'try now', 'eventVal':0, 'nonInteraction': 0, }); }); //"Sign in" nav button tracking $('#nav-signIn').on('click', function() { dataLayer.push({ 'event': 'eventTracker', 'eventCat':'marketing', 'eventAct':'nav', 'eventLbl':'sign in', 'eventVal':0, 'nonInteraction': 0, }); }); })(jQuery);