UTM Parameters and Hidden Form Fields

Are utm parameters in a URL the only way to pass data to hidden form fields?

I have a client who has a dynamic event registration flow in Wordpress. A user types in their zip code, is presented with a list of events nearby. Then they select the event they want to attend and are presented with a HubSpot Form for Registration. I need the hidden fields in the form to capture the event location, date, and time that they selected.

I imagine this can be accomplished with utm parameters in the url, but are they other ways--for example using JS--to pass data into a hidden form field?

Thanks!

Hey @TShannon3, Happy Friday!

HubSpot allows you to create custom properties (fields) within your form. You can configure these fields to be hidden and then populate them with values using HubSpot’s built-in functionality.

To our top experts, @Anton and **@matthew-aire **any recommendations for **@TShannon3 **matter?

Thank you,

Pam

Hi @TShannon3

Definitely you can add this via UTMs in a URL. This can also be done using JS, please review this code here.

Let me know how it goes!

Many thanks,

Matt Aire
HubSpot Freelancer | Founder @ pocketpros
Let's chat HubSpot - book a meeting

:ok_hand: If my reply was useful and helped answer your question, please mark it as a solution to help the community!

The link to the code is no longer accessible