HubSpot Ideas

pingle

Ability to redirect to multiple thank you page based on form response

On a form, there is a field with two different responses, which helps to determine the ideal customer. It is very important to have the feature to redirect a visitor to separate thank you pages based on the response. To B2B customers, we sell our products directly but to B2C customers, we redirect them to e-commerce channels (such as eBay or Amazon). In this case, both the types of customers are important. We can use one landing page and form to target both types of audiences to promote the product but redirect them to the relevant offer/content based on the response.

 

136 Replies
PoorviJhawar
Member

This would be an absolute blessing for us to redirect our demo users in a relevant direction instead of a generic Thank you page and then emailing information. This would cause less friction for the visitors, making it an effortless experience. 

Peta_APB
Contributor | Gold Partner

Hi there, I've been following this thread with great interest and attempting to implement this on a HS landing page. I can't seem to get this working however so hoping someone could shed some light?

I'm using multi-dropdown select box in my form, so I've been trying to adjust the embed code from @anders_grove but I'm not 100% certain on how to do this.

 

I'm using a HTML module in the landing page to embed the modified code, is that correct?  It's just not appearing at all on my page so I'm obviously going wrong somewhere.

 

Then I'm trying to adjust the code as  follows but again, not 100% sure if I've got it right - any help would be greatly appreciated:

 

 

 

<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
	hbspt.forms.create({
		portalId: "xxxxxx",
		formId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
		css: "",
		onFormSubmit: function($form) {
			var choice = $('select[name="catagory"]').val(); << Is this the name of the contact property field? >>
			if (choice == 'Dropdown Select Option 1') {
				window.location = 'https://example.com/landingpage1';
			} else if (choice == 'Dropdown Select Option 2'){
				window.location = 'https://example.com/landingpage1';
			} else if (choice == 'Dropdown Select Option 3'){
				window.location = 'https://example.com/landingpage2';
			} else if (choice == 'Dropdown Select Option 4'){
				window.location = 'https://example.com/landingpage3';
			} else if (choice == 'Dropdown Select Option 5'){
				window.location = 'https://example.com/landingpage4';
			}
		} 
	});
</script>

 

Looking forward to any suggestions/corrections :).

 

Thanks so much.

 

Peta

 

 

anders_grove
Contributor | Elite Partner

Hey @Peta_APB,

 

Your code looks correct. Only thing I can see is maybe the spelling on catagory is wrong?

 

$('select[name="catagory"]').val();

 ^ This is the name of the select field.

choice == 'Dropdown Select Option 1'

^ The value is the value of the select options.

See below image for a reference:

 forms.png

 

Hope that helps!

ljschwabtx
Member

@Peta_APB is your site hosted on Hubspot? I copied this code and tried to use it and nothing happened. It turned out that it was because Hubspot it my CMS so we had to make changes. Happy to share if that helps. 

Peta_APB
Contributor | Gold Partner

Hi @anders_grove , thanks for the reply.  Yes catagory spelt incorrectly but this error was because when the contact property was created it was done with a typo....hence the internal name is unable to be changed..... So I presume I use the internal name for the form field name?

And @ljschwabtx  thanks for the reply as well and yes this is going to be used on a Hubspot landing page, however I am even testing on a ClickFunnels landing page and it's just not working.  Are you able to share what changes you made to get this to work?

 

Thanks for your help.

 

Warm regards

Peta

FadiGeorge
Participant | Platinum Partner

Yes, please! Upvoted.

gu_dev_c
Member

This is a must. Pushing customers to appropriate landing pages based on an a selection is fairly basic. Grant us the ability to utilize "Thank You Code" and expose the form variables to that code so we can dynamically redirect customers via javascript.

notifytech
Member

It would be great for users to be directed to various thank-you pages depending on an option they have ticked on a form.

vylip
Member

Absolutley - i neeeeeeeed this as well!

jamabryan
Participant

We need this as well. 

 

I tried using the code but have found that the contact/form information is not consistently making its way to Hubspot nor are we getting notified of the form submission. The redirect is happening faster than the info is getting into Hubspot and then it's getting lost.

 

Hubspot suggested changing onFormSubmit to onFormSubmitted, but that didn't redirect at all.

 

We've gone back to our original solution, which was using PlusThis SmartLinks. 

ikleveland
Member

This feature is simple. Would literally increase my convergence 10 fold. 

Most of the emails end up in spam or go unread when sending the lead the correct page. 

COME ON HUBSPOT !!!!

whybe
Participant

+1

Harris
Participant

This would be great.

JoeMayall
HubSpot Alumni

Hi HubSpot Community,

 

My name is Joe, I'm the Ideas Forum Manager. I wanted to thank you for your thoughtful comments on this post. Your feedback helps us build better products.

 

I think this a great Idea! I'm happy to say we are currently reviewing this request and its feasibility. At this time I don’t have any details around timing or delivery, but all updates will be relayed on this thread.

I am changing the status of this idea to Being Reviewed as our team scopes out this work.


Best,
Joe

katherineadelma
Member

I am looking into this, we have a dropdown for Roles, and i want to redirect the Consumer to a page, while the rest of the roles get a thank you message.

 

I am not even sure how to go bu this, and i tried Anders's form but it's not working at all.

MyCaptain
Participant

We need this! It's really unfortunate that this idea is not implemented yet. It was posted in 2017. 3 Years Back. Also, an On/Off Button to take care of the forms submissions, like it's there in google forms will be great. 

anna_bielawski
Member

This would solve so many issues for us - is there a status update or timeline for delivery? 

 

Thanks!

LauraCH
Participant

This is quite basic for people running Marketing campaigns for Saas products! Especially when it comes to automating the optimization of paid media by doing it based in the thank you page for qualified leads instead of everybody!

 

 

abockler1f
Contributor | Diamond Partner

This would work great for a use case I have right now.

 

Our client has put together a landing page with a third party. We provided a form for the third party to use so that we can track contacts who convert within HubSpot. The form has two different options people can pick for downloadable content to receive - based on which option they pick, we'd like to return a specific Thank You page with that offer.

wicara
Participant

Any news on this one this is exactly what we need