Lead Capture Tools

michelegarcia
Participante | Partner nivel Diamond
Participante | Partner nivel Diamond

Redirect to External URL Based on Form Field

resolver

When a contact submits a form, is it possible to redirect to external URL based on the answer of a form field?

1 Soluciones aceptada
jennysowyrda
Solución
Administrador de la comunidad
Administrador de la comunidad

Redirect to External URL Based on Form Field

resolver

Hi @michelegarcia

 

A form cannot be redirected immediately based on a field updated in a form submission. This is because it takes time for the information to be sent to HubSpot, propogate on the contact record, and then inform which page the contact sees. All of this takes longer than the url redirecting from the form to the next page. 

 

With that said, if you can create a buffer page that a contact visits before arriving at the next page, that is one workaround. 

 

If you can share a little bit more about your end goal, the Community can assist. 

 

cc: @KatieSchieder@ndwilliams3@HelenRoss

 

Ver la solución en mensaje original publicado

11 Respuestas 11
HelenRoss
Colaborador

Redirect to External URL Based on Form Field

resolver

Just from a broader context, I'm a little confused by this one (mostly in why you would want to push a user AWAY from your site). 

 

Can you give us a bit more of the use case behind the question?

michelegarcia
Participante | Partner nivel Diamond
Participante | Partner nivel Diamond

Redirect to External URL Based on Form Field

resolver

The external URL is part of one of my client's websites.

0 Me gusta
jennysowyrda
Solución
Administrador de la comunidad
Administrador de la comunidad

Redirect to External URL Based on Form Field

resolver

Hi @michelegarcia

 

A form cannot be redirected immediately based on a field updated in a form submission. This is because it takes time for the information to be sent to HubSpot, propogate on the contact record, and then inform which page the contact sees. All of this takes longer than the url redirecting from the form to the next page. 

 

With that said, if you can create a buffer page that a contact visits before arriving at the next page, that is one workaround. 

 

If you can share a little bit more about your end goal, the Community can assist. 

 

cc: @KatieSchieder@ndwilliams3@HelenRoss

 

tomasver
Miembro

Redirect to External URL Based on Form Field

resolver

Hi @jennysowyrda ,

i am trying to achieve the same as @michelegarcia . How does the buffer page works? Do you have any documentation i can use?

THanks,
Tomas

0 Me gusta
jennysowyrda
Administrador de la comunidad
Administrador de la comunidad

Redirect to External URL Based on Form Field

resolver

Hi @tomasver,

 

You would need to direct the form submission to a thank you page on your website, and then from there the traffic can be directed to another page (through a CTA or link).

 

Thank you,
Jenny

michelegarcia
Participante | Partner nivel Diamond
Participante | Partner nivel Diamond

Redirect to External URL Based on Form Field

resolver

It worked, thanks!

0 Me gusta
JReese
Miembro

Redirect to External URL Based on Form Field

resolver

Great news, @michelegarcia! Would you mind sharing how you got it to work, please? Basically, I'm trying to use a single form to gate multiple assets and pass which asset the user signed up for through a parameter. (If there's a better way to do this, please feel free to point me in the right direction!) Thank you!

0 Me gusta
deejmer
Miembro

Redirect to External URL Based on Form Field

resolver

@michelegarcia- If you are hip to it, I'd love to see how you solved this. Mind sharing your code?

0 Me gusta
Jenniferkw1
Miembro

Redirect to External URL Based on Form Field

resolver

Could you share how you accomplished this?   I am trying to do the same thing without a buffer page.  It's a redirect to an external white-label service, depending on which field they pick in a dropdown.

0 Me gusta
ndwilliams3
Asesor destacado

Redirect to External URL Based on Form Field

resolver

The redirect url is set based on the redirectURL parameter in the form script when the form is loaded. However, all the form parameters are placed in a hidden field called hs_context that's submitted along with the form. I haven't tested this, but you could problably use javascript to manipulate the redirectURL parameter in the hs_context field based on your field value options. Just a thought if you've have a developer on your team.

e5an
Colaborador

Redirect to External URL Based on Form Field

resolver

Just tried this, it doesn't work.

It is possible to change the value of that field with javascript but doing that has no effect- the form still redirects to the original URL.