SOLVED

Landing Page User Experience

Go to solution
Yash
Level 4

Landing Page User Experience

To enhance the user experience for our landing pages I have been instructed to do this. Whenever a user submits a form on the landing page and for instance if the landing page is all about an eBook/whitepaper, we want them to see the eBook on a new tab and the current landing page window should simply redirect to our home page. Can anyone please suggest as to how we can achieve this.

1 ACCEPTED SOLUTION

Accepted Solutions
Yash
Level 4

Re: Landing Page User Experience

Thanks @SanfordWhiteman 

Our landing pages are based out of pre-defined templates and the forms used inside is built out separately.

This is how our landing pages would look like:

 

unnamed.jpg

 As you can see in the above snapshot I have added a separate HTML component at the last and have defined the script as following:

<script>
MktoForms2.whenReady(function(form) {
var formEl = form.getFormElem()[0],
thankYouWindow;
form.onSubmit(function(form) {
thankYouWindow = window.open('');
});
form.onSuccess(function(vals, thankYouURL) {
thankYouWindow.document.location = 'https://Your_Guide.pdf';
window.location.replace("http://www.ourhomepage.com/");
return false;
});
});
</script>

 

This is working fine for me but just wanted to get this to you for your review. At the initial stage I tried adding the script within 'Edit Meta Page Tags' from the landing page properties but didn't work and then from the other threads I learned you suggested it to be added before the ending body tag and which is why I have added this as an HTML component right below the footer.

 

Thanks for all your help.

 

 

 

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Landing Page User Experience

If you search "thank you new window" there are many past discussions. 

Yash
Level 4

Re: Landing Page User Experience

Thanks @SanfordWhiteman 

Our landing pages are based out of pre-defined templates and the forms used inside is built out separately.

This is how our landing pages would look like:

 

unnamed.jpg

 As you can see in the above snapshot I have added a separate HTML component at the last and have defined the script as following:

<script>
MktoForms2.whenReady(function(form) {
var formEl = form.getFormElem()[0],
thankYouWindow;
form.onSubmit(function(form) {
thankYouWindow = window.open('');
});
form.onSuccess(function(vals, thankYouURL) {
thankYouWindow.document.location = 'https://Your_Guide.pdf';
window.location.replace("http://www.ourhomepage.com/");
return false;
});
});
</script>

 

This is working fine for me but just wanted to get this to you for your review. At the initial stage I tried adding the script within 'Edit Meta Page Tags' from the landing page properties but didn't work and then from the other threads I learned you suggested it to be added before the ending body tag and which is why I have added this as an HTML component right below the footer.

 

Thanks for all your help.

 

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Landing Page User Experience

Looks fine to me.

Yash
Level 4

Re: Landing Page User Experience

You're a lifesaver, thank you @SanfordWhiteman !