Hey Community,
Our company is in the process of migrating all of our landing pages from Drupal into MKTO. As our "Number of employees" thresholds change roughly every 6 months, we use Global Forms to limit the number available across our website. We are now starting to broaden the number of landing pages to customize the content specific to ads the prospects are clicking through. Here is my question...
How can I direct prospects to the Thank You page that matches the Landing page without touching the Global form? Our web designer enabled this on our Drupal forms by hardcoding the Thank You page into the form embed code of the original Landing page.
Does anyone have an easy way to do this? I know I want the form submitted on Xa page to direct to Xb thank you page but as I mentioned, do not want to modify the global form as we want to enable 1 form to live on 100s of landing pages.
Thanks in advance!
Solved! Go to Solution.
Couldn't be easier:
form.onSuccess(function(vals,thankYouURL){
switch(document.location.pathname) { // or whatever you want to use to detect current page
case '/mightyfine.html':
document.location = '/thanks-mightyfine.html';
break;
case '/redredwine.html':
document.location = '/thanks-redredwine.html';
break;
...
}
return false;
});
See the Forms 2.0 API docs.
Keith Nyberg FYI. I moved your post to Products and Support so you get an answer faster..
Thanks Scott! Airhead move by me...
Couldn't be easier:
form.onSuccess(function(vals,thankYouURL){
switch(document.location.pathname) { // or whatever you want to use to detect current page
case '/mightyfine.html':
document.location = '/thanks-mightyfine.html';
break;
case '/redredwine.html':
document.location = '/thanks-redredwine.html';
break;
...
}
return false;
});
See the Forms 2.0 API docs.
Hey Sanford! Thanks for the post. I tried with our web developer and ended up using the code documented in the Developers: Marketo For Website > Forms 2.0 which had a little more detail which helped us. Forms 2.0 » Marketo Developers
The code looks like this...
We actually piggy backed the function(form) { onto our form embed code which we have tokened and it works great without touching the templates.
I have a global form which is used on translated landing pages. The form on submit goes to an external thank you page (english language). Could I use this solution to force the form on submit to go to each of the separate translated thank you pages?
Of course! Hopefully, your localized pages have a consistent part of the path (or query string) so you can change the Thank You URL accordingly (e.g. lp.html?lang=en goes to thankyou-en.html, etc.).