new MutationObserver(function(mutationsList, observer) { for(const mutation of mutationsList) { if (mutation.type === 'childList') { if(mutation.target.id === "raen-optics"){ if(mutation.addedNodes.length === 1){ if(mutation.addedNodes[0].id && mutation.addedNodes[0].id.includes("bx-campaign-")){ //Look for nodes added by wk let cId = mutation.addedNodes[0].id.split("-")[2] bouncex.campaigns[cId].event_js.submission = "window._klOnsite = window._klOnsite || []; if(mobileCheck()===false){window._klOnsite.push(['openForm', 'Sdwfa8']);}else{window._klOnsite.push(['openForm', 'QYQEBL']);}" document.querySelectorAll("button.bx-button[type='submit']").forEach((btn) => { btn.addEventListener("click", function(){ // add event listener to capture entered email address let parentClass = btn.parentNode.className if (parentClass && parentClass.includes("bx-row-submit-default")){ let eInput = btn.parentNode.parentNode.childNodes[0].querySelectorAll("input[type='email']")[0] try { let email = eInput.value if(email.length > 0){ // if a complete email entered, identify the user klaviyo.identify({ "$email": email }) } }catch(e){} } }) }) } } } } } }).observe(document, {childList: true, subtree: true});