How can I show visitors a confirmation dialogue and redirect?

  • 5 July 2021
  • 4 replies
  • 156 views

Upon submitting the form on my lead gen LP, I’d like to initially show my visitors a form confirmation dialogue that says “Thank you! Your ebook is on it’s way to your inbox.” and then after a few seconds, automatically redirect them to another page.

Is there anyway to do this? I found an old post in the community that linked to a script, but that just sends me to a 404 page now.

Any help would be appreciated!

Thank you 🙂


4 replies

Hi Joe -

I have this working on a current project like this: Once the user submits the form on the “Optin/Promo” landing page, that form redirects to a “Thank You! Your eBook is on its way to your inbox” landing page. On the “Thank You” landing page add this script to the Javascript section (before body end tag) and update the URL you want your Thank You landing page to delay redirect to (you can adjust the delay time here: var delay = 10;):

<script>
 
  (function(){
  
    // Your URL
    var url = 'https://www.yourpagetoredirectURLgoeshere';
  
    // Delay before the redirect takes place, in seconds
    var delay = 10;
    
    window.setTimeout(function() {
     window.open(url, '_parent');
    }, delay * 1000);
  
  })();
 
</script>

Hey Thancan,

I just implemented this code in the Javascript section, and it’s not working. I get a “wwww.myurl.com refused to connect” message. Any clue what’s up? I am redirecting to a url that is not connected as a domain on Unbounce. Could this be why?

Thanks!

Hi masterofnone -

You will need to have a “published/active” URL for this to work as a redirect. If your URL is published/active, then double-check that it is correctly pasted in the code above and that none of the semi-colons or anything else were accidentally deleted or copied over - it happens 🙂 Hope this helps.

Hi! Thanks so much … I published, and it is, indeed, working! I really appreciate your code and your reply!

Reply