APIs & Integrations

SClick
Member

Pass WP Customer Fields into HS Hidden Fields

SOLVE

Hoping someone can help!

We're looking at using a single form across multiple piece of content and want to add custom field text directly into a Hubspot hidden field on the page (in order to track the content downloaded into a field).

 

Does anyone know how we might be able to call up the custom field on page load and populate it into the HubSpot hidden field!

1 Accepted solution
JBeatty
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Pass WP Customer Fields into HS Hidden Fields

SOLVE

Hi @SClick,

 

If you are able to contol the URL you can just add a query parameter to the URL and autofill the hidden field. For exampel if the form is on www.example.com/form/here and the hidden property internal name is "hidden_property" you can change the url to be www.example.com/form/here?hidden_property=12345 to autofill 12345 into the hidden property on the form. If you can not control the URL but you can control the embed code you can modify the onFormReady function to set the value. See the documentation for that here: https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options

 

Best,

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk

View solution in original post

1 Reply 1
JBeatty
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Pass WP Customer Fields into HS Hidden Fields

SOLVE

Hi @SClick,

 

If you are able to contol the URL you can just add a query parameter to the URL and autofill the hidden field. For exampel if the form is on www.example.com/form/here and the hidden property internal name is "hidden_property" you can change the url to be www.example.com/form/here?hidden_property=12345 to autofill 12345 into the hidden property on the form. If you can not control the URL but you can control the embed code you can modify the onFormReady function to set the value. See the documentation for that here: https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options

 

Best,

✔️ Was I able to help answer your question? Help the community by marking it as a solution.

Joshua Beatty
Software Developer with Pearagon

Still have questions? Let's Talk