Marketo Form embedded on Non Marketo Page and Need it to go to a specific landing page | Community
Skip to main content
Level 2
March 2, 2020
Question

Marketo Form embedded on Non Marketo Page and Need it to go to a specific landing page

  • March 2, 2020
  • 1 reply
  • 5372 views

We are embedding Marketo Forms on website pages in WordPress. 

I would like for the forms to go to specific landing pages and know that I can't define that in Marketo. 

Is there a piece of code you can add to the form to redirect it to a specific thank you page on completion. This is the code I am working with now:

 

<script src="//app-ab39.marketo.com/js/forms2/js/forms2.min.js"></script><form id="mktoForm_1015"></form> <script>MktoForms2.loadForm("//app-ab39.marketo.com", "194-ATY-897", 1015);</script> <script>MktoForms2</script> <script>MktoForms2.whenReady(function(form) { form.onSuccess(function(values,www.juvare.com/thank-you-test-page/) }); </script>

1 reply

SanfordWhiteman
Level 10
March 2, 2020

I would like for the forms to go to specific landing pages and know that I can't define that in Marketo. 


Why can't you use Add Choice for Thank You URLs, specifically?

 

(Also, pls highlight any code you post using the Syntax Highlighter so it's readable.)

Level 2
March 2, 2020

The Add Choice function only allows me to choose based off a form field and where the thank you pages need to go is not based off a form field, it is based off what they are downloading.

SanfordWhiteman
Level 10
March 2, 2020

Add a Most Recent Asset Download field to your instance, and add it as a Hidden field in Form Editor.

 

This enables you to use Add Choice and not have to manage Thank You URLs themselves in JavaScript (which is totally possible, but unnecessarily complex if you're not a developer). 

 

To add the asset field would be a tiny bit of JS:

 

 

MktoForms2.whenReady(function(form){ form.setValues({ MostRecentAssetDownload : "/some/value/output/by/WordPress" }); });

 

 

The field value would be a WordPress user variable, or any other way WP knows the asset name.

 

(Again pls highlight your code above using the Syntax Highlighter, it's not readable otherwise.)