One form on many (non marketo) pages redirecting to different (non marketo) page | Community
Skip to main content
Matt_Lyman
Level 2
October 22, 2015
Question

One form on many (non marketo) pages redirecting to different (non marketo) page

  • October 22, 2015
  • 2 replies
  • 3773 views

We are using a standard form inside of multiple modals on our website. One of these modals needs to redirect to a different landing page than the others. None of these pages are hosted in Marketo, just the forms.

I know we can do redirects on the form, however, we don’t want it throughout ALL uses of that form, just on one.

Have any of you solved this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Grégoire_Miche2
Level 10
October 22, 2015

Hi Matt,

I gather that the forms are embedded.

This means you are using the forms 2.0 api to do so.

One of the examples given here Forms 2.0 » Marketo Developers  explains how you can reroute the follow-up page. You can start from this. Il will require some Js capabilities.

-Greg

Kenny_Elkington
Adobe Employee
Adobe Employee
October 22, 2015

Example 2 shows this capability.  I suggest modifiying it somewhat and using the following instead:

  1. MktoForms2.whenReady(function(form) {
  2.    // Add an onSuccess handler
  3.   form.onSuccess(function(values, followUpUrl) {
  4.    // Get the form's jQuery element and hide it
  5.   form.getFormElem().hide();
  6.    // Return false to prevent the submission handler from taking the lead to the follow up url
  7.    return false;
  8.    });
  9. });

You will need to set followUpUrl to equal the URL of the page you want to redirect to.

November 4, 2015

I understand this for thank you pages, but what about deploying an auto responder email with the asset based on query string parameters or JS code? Has anyone done this?

SanfordWhiteman
Level 10
October 22, 2015

Matt, if the page happens to have a unique query param you can also do this without JS:

- add hidden field, enable Autofill to get value from the query param

- under Thank You Page, click Add Choice and switch the URL based on the hidden field's value

Courtney_McAra4
Level 4
October 27, 2015

This sounds intriging to me but can you confirm

The query parameter is anything after the? in the URL, correct?  such  as www.mywebsite.com/resources/awesome-case-study.html?content=5555. 

Where i know content 5555 means direct them to TY Page with the right PDF, or whatnot.

What if someone happens to go the URL and doesn't have the query piece after the ?.  

SanfordWhiteman
Level 10
October 27, 2015

Query parameter​s are all after the ?, yes.  Like key=value&key2=value2, etc.

If the query parameter is not present, you'd just send them to a default choice.