Apply one Marketo Form to a page with different redirects based on URL | Community
Skip to main content
Level 2
September 26, 2013
Question

Apply one Marketo Form to a page with different redirects based on URL

  • September 26, 2013
  • 1 reply
  • 954 views
We are running into an issue using only one Marketo Form in our website.  We are trying to redirect each user to a protected content page based on the current website URL parameters. For example, the webinar page contains many links where each links leads to a different page. Each page contains a sample video and a Marketo form.  If the user wants to view the full video, they are required to fill out the form.  By using JavaScript, we would like to grab the current URL pathname and redirect them to a protected content page displaying the full video instead of redirecting them to the Marketo default external link within the Market form.
As of right now, the Marketo Form’s default URL is our company website and we are doing the testing on our subdomain website. In the Marketo form editing page, we are using an External URL which is our subdomain URL.
Our problem occurs when the user submits a Marketo form; I added an alert/console.log into my JavaScript to read the current URL of the page. The current URL links back to the Marketo form default URL which is our Company site URL instead of the Company Subdomain URL. We need the Marketo form to read our subdomain URL instead of the default URL so we can grab the subdomain URL pathname. Can anyone please help me how to approach this issue? Thank you.
 
Marketo form default URL: http://company.com/WebsiteView.html
Company site: http://company.com
Company subdomain site: http://company.subdomain.com

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

1 reply

October 4, 2013
Hi Joe, 

My team ran into a similar issue and ended up having to abandon the 'normal' embed option for webforms to solve the problem. 

We used this technique: http://community.marketo.com/MarketoArticle?id=kA050000000KyqgCAC 

There are 2 values in the form's HTML of interest to you:  ReturnURL and RetURL... If you set these values dynamically via javascript before the form submits, you will get the dynamic redirect functionality you're after.  However, when embedding the form with the HTML code you do not get progressive profiling or autofill features (these are only available within the iframe embed)  This wasn't a big deal for us because our site already has a cookie based autofill but thought I should mention it.

hope it helps!