SOLVED

Show Thank You Message Without a Follow-Up Landing Page

Go to solution
Anonymous
Not applicable

Hello,

We are using Marketo forms embedded on our external website. We have followed the instructions from the developer tools on how to use JavaScript to have a confirmation message appear after the form is completed, rather than lead to an separate landing page. (Instructions: http://developers.marketo.com/blog/show-thank-you-message-without-a-follow-up-landing-page/ ) These confirmations are working correctly for individual form fill-outs with no issue.

However, we have a newsletter subscription form that is permanently in the footer of our website. We have noticed that on pages where our resource download forms exist, the confirmation appears on the resource form after completion, as well as subscription form at the bottom.

Does anyone know what we have to edit in our JavaScript to make sure that the confirmation only appears for that specifically identified form?

Thank you!!

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

Yes, that code adds the listener to all Marketo forms, so any form that was successfully submitted gets the Thank You message.

To address only specific forms, you can adapt the code like this:

MktoForms2.whenReady(function (form){

  var samePageTYForms = [122,222,656];

  if ( samePageTYForms.indexOf(form.getId()) != -1 ) {

     form.onSuccess(function(values, followUpUrl){

       // rest of listener code omitted for brevity

     });

  }

});

Where samePageTYForms is an array of the form IDs for which you want to use same-page Thank You.  Any other forms will be ignored.

You might also check the method on my post http://blog.teknkl.com/same-page-thank-you-text-with-marketo-forms-about-the-aliid/ which I (naturally!) find more flexible.

View solution in original post

5 REPLIES 5
Benjamin_Ortiz1
Level 4

Is there a way to do this using the guided landing pages?

Grégoire_Miche2
Level 10

Yes, you just need to add the script at the end of the landing page or it's template.

<script>

MktoForms2.whenReady(function (form) {

  var samePageTYForms = [122,222,656];

  if ( samePageTYForms.indexOf(form.getId()) != -1 ) {

    form.onSuccess(function(values, followUpUrl){

      // rest of listener code omitted for brevity

    });

  }

});

</script>

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Yes, that code adds the listener to all Marketo forms, so any form that was successfully submitted gets the Thank You message.

To address only specific forms, you can adapt the code like this:

MktoForms2.whenReady(function (form){

  var samePageTYForms = [122,222,656];

  if ( samePageTYForms.indexOf(form.getId()) != -1 ) {

     form.onSuccess(function(values, followUpUrl){

       // rest of listener code omitted for brevity

     });

  }

});

Where samePageTYForms is an array of the form IDs for which you want to use same-page Thank You.  Any other forms will be ignored.

You might also check the method on my post http://blog.teknkl.com/same-page-thank-you-text-with-marketo-forms-about-the-aliid/ which I (naturally!) find more flexible.

Anonymous
Not applicable

This worked perfectly - thanks so much Sanford!

Anonymous
Not applicable

Thanks Sanford, this is cool!