Swapping form on landing page with HubDB

SOLVE
Occasional Contributor
I am using HubDB to pull dynamic content into a single landing page. However, I need to change the form that is loaded on this page based on the URL with the rest of content coming from HubDB.

Does anyone know of a solution to this? I don’t want to create 5 different landing pages just for a form.
Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Occasional Contributor

Thanks! Solved this in the end by creating a custom hubspot property and adding this property as a hidden field in the form. You can then pass the property into the url and this will populate the hidden fields data.

e.g. example.com?internal_property_name_here=test

https://knowledge.hubspot.com/forms/can-i-auto-populate-form-fields-through-a-query-string

4 Replies 4
Advisor

Hey @hd-hs 

 

Might you be able to create multiple forms, add a column in your DB with the corresponding form ID, and use hubl to place it into the page. This way the form wouldn't necessarily be based on the URL/query-string but rather data from the DB.

Occasional Contributor

Thanks! Solved this in the end by creating a custom hubspot property and adding this property as a hidden field in the form. You can then pass the property into the url and this will populate the hidden fields data.

e.g. example.com?internal_property_name_here=test

https://knowledge.hubspot.com/forms/can-i-auto-populate-form-fields-through-a-query-string

Advisor

Edge case alert:

What happens if the user manually types in the URL and forgoes the querystring?

 

Have you got a fallback in place?

Highlighted
Occasional Contributor
These URLS are coming from PPC ads and therefore set from my side. Sorry, should have said! If they remove the query string later down the line I am not too worried as I am only interested in direct traffic from the ads at the moment!