function receiveMessage(event){ if (event.origin !== "https://franksautocredit.neoverify.com/") return; if (event.data == 'neoApplicationSubmitted'){ //trigger analytics event tracking here and redirect user to application form var thankYouPageUrl = 'https://www.franksautocredit.net/thank-you-credit/' window.location.href = thankYouPageUrl; }; }; window.addEventListener("message", receiveMessage, false);