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

Joe_Johnson
Level 1

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

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

Tags (1)
1 REPLY 1
Anonymous
Not applicable

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

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!