Lead Capture Tools

christoph88
Participant

hidden form fields in hubspot cta

SOLVE

Hi, I am trying to use hidden fields in a hubspot form which is embedded in a hubspot CTA. (an exit popup with a form). What is the best way to update these hidden values? Within forms can you add a callback on form create but as far as I see there is no possibility to do this for CTA's/popups?I want to update the hidden values of the form using javascript since the data I need is within the dataLayer/dom outside of Hubspot.

0 Upvotes
1 Accepted solution
TomM2
Solution
Thought Leader | Platinum Partner
Thought Leader | Platinum Partner

hidden form fields in hubspot cta

SOLVE

@christoph88 I agree! The pop-up CTAs is still a very new feature, so the product team are actively trying to improve on this. I'd definitely recomend adding this as a feature request to them through the HubSpot ideas forum here

Tom Mahon
Technical Consultant | Solutions Engineer | Community Champion
Baskey Digitial

Book a meeting

Did my post help answer your query? Help the community (and me) by marking it as a solution.


View solution in original post

6 Replies 6
christoph88
Participant

hidden form fields in hubspot cta

SOLVE

Hi @kennedyp ,

I saw that thread an it's actually very similar to what I want to do.

We want the send the ga4 client_id within the hubspot hidden fields. 


In case we don't want to send the client id we could send info like isp or other information (we are a telco firm).

 

All that data will be used for analysis of customers and leads.

 

This indeed has to be dynamically filled in. For regular forms I saw the callbacks but you cannot use the form.create function within a hubspot CTA.

 

I saw the thread but wasn't a real solution there.

 

kind regards,

 

Christoph

0 Upvotes
christoph88
Participant

hidden form fields in hubspot cta

SOLVE

Hi, I am trying to use hidden fields in a hubspot form which is embedded in a hubspot CTA. (an exit popup with a form). What is the best way to update these hidden values?

 

Within forms can you add a callback on form create but as far as I see there is no possibility to do this for CTA's/popups? I want to update the hidden values of the form using javascript since the data I need is within the dataLayer/dom outside of Hubspot.

0 Upvotes
TomM2
Thought Leader | Platinum Partner
Thought Leader | Platinum Partner

hidden form fields in hubspot cta

SOLVE

Hey @christoph88 this isn't currently possible within CTA forms. HubSpot forms allows you to access the embed code so you can add in your own callbacks in here, they also populate with URL query strings.  I'm not sure if pop-up forms populate with query strings, I doubt it but I haven't tried on the new embed for pop-ups yet, it might be worth testing!  

 

Regarding the callbacks and embed code however, this isn't currently possible as the pop-up embed is injected on page load through the tracking code. So there's no form embed code to edit your callback into. They also use pretty dynamic IDs from what I've seen and the pop-up forms load within an iframe, so you can't pass anything to the DOM of it. 

Tom Mahon
Technical Consultant | Solutions Engineer | Community Champion
Baskey Digitial

Book a meeting

Did my post help answer your query? Help the community (and me) by marking it as a solution.


0 Upvotes
christoph88
Participant

hidden form fields in hubspot cta

SOLVE

The query parameters work in CTAs but aren't useable in my usecase. I really find this a lacking feature. Having those hidden fields available would make the forms 100x more powerfull.

0 Upvotes
TomM2
Solution
Thought Leader | Platinum Partner
Thought Leader | Platinum Partner

hidden form fields in hubspot cta

SOLVE

@christoph88 I agree! The pop-up CTAs is still a very new feature, so the product team are actively trying to improve on this. I'd definitely recomend adding this as a feature request to them through the HubSpot ideas forum here

Tom Mahon
Technical Consultant | Solutions Engineer | Community Champion
Baskey Digitial

Book a meeting

Did my post help answer your query? Help the community (and me) by marking it as a solution.


kennedyp
Community Manager
Community Manager

hidden form fields in hubspot cta

SOLVE

Hi @christoph88! Welcome to the Community-- happy to have you here 😊

 

I understand your goal is to pre-populate hidden fields on a pop-up form with data from outside of HubSpot using javascript. This sounds similar to how you can auto-populate form fields on a page by adding query strings to the page URL (Knowledge Base article), but we have a layer of complexity assuming these fields would be populating dynamically, correct?

 

Could you describe an example use case of these values? That additional context may help us find a resolution! 

 

One of our experts @TomM2 gave some insight on this similar post, so I recommend checking out that thread for some added value! 


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes