# Hidden Fields

**URL:** <https://community.hubspot.com/t/hidden-fields/104355>\
**Category:** Lead Capture Tools\
**Tags:** enterprise\
**Created:** [April 8, 2024, 3:38pm UTC](https://community.hubspot.com/t/hidden-fields/104355 "2024-04-08T15:38:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JMcNease](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@JMcNease](https://community.hubspot.com/u/JMcNease)\
**Post date:** [April 8, 2024, 3:38pm UTC](https://community.hubspot.com/t/hidden-fields/104355/1 "2024-04-08T15:38:11Z")

</div>

Hi there!

We are trying to capture a few different things with hidden fields - we were able to do this with API, but weren’t able to capture source information. So now we’re embedding the fields, but losing our hidden field capturing.

First hidden field: part of our website url

We’re trying to capture the product of a product inquiry form - we have over 3,500 products across 27 translated sites. Using the hidden field has been a life saver for segmenting. Any advice would be appreciated!

Another hidden field we’ve been utilizing is the button click - we have 1 form used for multiple CTAs on a page - for example, Speak to an Expert or Request Price are the same form, and we’ve been able to differentiate in a hidden field.

Does anyone know a workaround to this?

Any advice would be helpful! We are working towards CRM integraiton as well and are not super close to it so we really rely on capturing A LOT of information on forms and pass on to our sales group that way - not ideal, but it is our current business state.

THANK YOU!

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [April 9, 2024, 7:30am UTC](https://community.hubspot.com/t/hidden-fields/104355/2 "2024-04-09T07:30:16Z")

</div>

Hi @JMcNease, I hope that you are well!  
I love to read your post, thank you for explaining your use case and for asking the Community!  
I have found for you similar threads that might be of interest:  
- [Passing URL data through a form submission](https://community.hubspot.com/t5/APIs-Integrations/Passing-URL-data-through-a-form-submission/m-p/239617)  
- The solutions from @trevordjones and [@Mike\_Eastwood](https://community.hubspot.com/t5/user/viewprofilepage/user-id/9259) on this post “[Pass additional web page info from WordPress using Hubspot Form](https://community.hubspot.com/t5/Lead-Capture-Tools/Pass-additional-web-page-info-from-WordPress-using-Hubspot-Form/m-p/346704)”  
- The solution from @TomM2 on this similar post “[Pass user info from HS embedded form to connected URL](https://community.hubspot.com/t5/Lead-Capture-Tools/Pass-user-info-from-HS-embedded-form-to-connected-URL/m-p/873737)”  
I also wanted to invite a couple of subject matter experts to this conversation: Hi @trevordjones, @TomM2 and [@Mike\_Eastwood](https://community.hubspot.com/t5/user/viewprofilepage/user-id/9259) do you have other suggestions to help @JMcNease in this use case, please?  
If anybody else has anything to add and/or share, please feel free to join in the conversation 🙂  
Thanks a lot and have a great day!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![Mike\_Eastwood](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mike_eastwood/32/70075_2.png) [@Mike\_Eastwood](https://community.hubspot.com/u/Mike_Eastwood)\
**Post date:** [April 9, 2024, 11:59pm UTC](https://community.hubspot.com/t/hidden-fields/104355/3 "2024-04-09T23:59:46Z")

</div>

Hi @JMcNease

We’ve done a lot of form customisation projects - typically I create a Custom Module (that holds a HubSpot Form) and the module [manipulates the form with Javascript](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options).

You can use the various methods to manipulate the form, the data, and how it’s processed.

The only gotcha is the form must be raw html.

If this all sounds [understandably] like gibberish then sendd me your meeting link and we can jump on Zoom for a chat.

Cheers

Mike

p.s. thanks for the mention [@BérangèreL](https://community.hubspot.com/t5/user/viewprofilepage/user-id/230185)

Here to learn more about HubSpot and share my HubSpot Knowledge. I’m the founder of [Webalite](https://www.webalite.com?utm_campaign=community-forum&utm_source=community&utm_content=signature) a Gold HubSpot Partner Agency based in Wellington, New Zealand and the founder of **Portal-iQ** the world’s first automated [HubSpot Portal Audit](https://portal-iq.com?utm_campaign=community-forum&utm_source=community-forum&utm_content=signature) that helps you work smarter with HubSpot.

---

<div class="post-metadata">

**Author:** ![aviafriat26](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/aviafriat26/32/82610_2.png) [@aviafriat26](https://community.hubspot.com/u/aviafriat26)\
**Post date:** [April 10, 2024, 8:30pm UTC](https://community.hubspot.com/t/hidden-fields/104355/4 "2024-04-10T20:30:38Z")

</div>

For capturing different info using hidden fields while embedding them, especially for product info from URLs and button clicks for CTAs, try these:

1. **JavaScript for Dynamic Fields** : Use JavaScript on your page to dynamically fill hidden fields based on the URL visited or the button clicked. This way, you can keep the source info and button click data.
2. **Query Strings in URLs** : Append product info or CTA type as query strings in the URL. Then, configure the form to automatically fill hidden fields based on these query strings.
3. **Third-party Tools** : Look into third-party tools that specialize in form enhancements and can seamlessly integrate with your current setup, offering more flexibility with hidden fields.

This setup should help maintain your segmentation efforts and ensure valuable data is captured efficiently for your sales team.

---

<div class="post-metadata">

**Author:** ![TomM2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tomm2/32/70887_2.png) [@TomM2](https://community.hubspot.com/u/TomM2)\
**Post date:** [April 11, 2024, 2:18pm UTC](https://community.hubspot.com/t/hidden-fields/104355/5 "2024-04-11T14:18:53Z")

</div>

Hey @JMcNease there’s really only 2 ways to add data to a hidden feild. Query strings or custom JS.

If a query string matches a contact property and value this will automatically be populated by the form. So if you have [website.com?firstname=Tom](http://website.com?firstname=Tom) the firstname field will be populated with the value “Tom”. This obviously requires the visitor to visit a specific url with your query string.

Outside of this the only option is to have custom JS on your website to take in a definition of a page and pass a specific value to your form. This sounds like what you need to be honest but the only way to achieve this is through custom development.
