APIs & Integrations

jferrerpmc
メンバー

Passing a hidden email value field from Hubspot Form to a thank you page

解決

I am looking for way to customize a form to pass the email field value onto a thank you page for tracking purposes after the form is submitted.

 

Using this form embed code to customize:

 

hbspt.forms.create({
portalId: '',
formId: '',
onFormSubmit: function($form) {
// YOUR SCRIPT HERE 
}
});

 

Currently when I hit submit on the form my thank you page url is not receiving the value and just shows email= {{contact.email}} instead of the actual email.

 

Please advise

0 いいね!
1件の承認済みベストアンサー
WendyGoh
解決策
HubSpot Employee
HubSpot Employee

Passing a hidden email value field from Hubspot Form to a thank you page

解決

Hi @jferrerpmc,

 

Happy to point you to similar discussion here!

 

If the first page that you're redirecting the form is built on HubSpot CMS, you can check out this thread here: https://community.hubspot.com/t5/APIs-Integrations/Pass-field-value-to-URL-parameter/m-p/240551 - The latest post by John has the solution to this issue.

 

If it's not built on HubSpot CMS, you mayw ant to check out this discussion: https://community.hubspot.com/t5/APIs-Integrations/Include-form-fields-as-redirect-URL-parameters-on... where Derek Cavaliero outlined the possible solution - by using the following code:

    onFormSubmit: function($form){
        setTimeout( function() {
            var formData = $form.serialize();
            window.location = "http://www.yoururl.com?" + formData;
        }, 250 ); // Redirects to url with query string data from form fields after 250 milliseconds.
    }

元の投稿で解決策を見る

0 いいね!
2件の返信
WendyGoh
解決策
HubSpot Employee
HubSpot Employee

Passing a hidden email value field from Hubspot Form to a thank you page

解決

Hi @jferrerpmc,

 

Happy to point you to similar discussion here!

 

If the first page that you're redirecting the form is built on HubSpot CMS, you can check out this thread here: https://community.hubspot.com/t5/APIs-Integrations/Pass-field-value-to-URL-parameter/m-p/240551 - The latest post by John has the solution to this issue.

 

If it's not built on HubSpot CMS, you mayw ant to check out this discussion: https://community.hubspot.com/t5/APIs-Integrations/Include-form-fields-as-redirect-URL-parameters-on... where Derek Cavaliero outlined the possible solution - by using the following code:

    onFormSubmit: function($form){
        setTimeout( function() {
            var formData = $form.serialize();
            window.location = "http://www.yoururl.com?" + formData;
        }, 250 ); // Redirects to url with query string data from form fields after 250 milliseconds.
    }
0 いいね!
jferrerpmc
メンバー

Passing a hidden email value field from Hubspot Form to a thank you page

解決

Thank you, this is very helpful! 

0 いいね!