Custom HS Hosted Save Actions

SOLVE
New Contributor

Hi All,

I have a hubspot hosted form successfully embeded to my external .Net site.

We want to migrate to HS forms from current form because of the flexibilty HS provide and leverage the potetial.

I am doing a POC where I am not sure how to achive below custom save action i am able to do with existing forms.

  1. Need to send HS form data to WebEx api. Currently we are using server side code to create a XML doc with form data and credential to post data to webex service.
  2. Right now we have multiple success message configuration, I want my leads to be able to download the whitepaper/datasheet(PDF) on asuccessful form submission
  3. Currentlly we are displaying a form when user click on a pdf-->they fill form-->successful submission message has the clicked PDF resource, actually we are creating a form post action which contains pdf unique guid to get pdf download link in success message. How do we do that here.
  4. I can programatically render the embed form but I am not sure how to check if submit action was successful.

I heard of Webhook, but I am not sure if this can help me achive the above functionalities  or HOW?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Solution
HubSpot Employee

Hi, @pphulariya.

 

Sincere apologies for the delayed response.

 

Submitting a hidden form on repeat downloads

 

I don't know of a way to submit a completely hidden embedded HubSpot form, but you can certainly make AJAX requests to this v3 Forms API endpoint for repeat submissions to the form. The API submissions are capable of updating contact records the same way as the HTML form. Said differently, you might have to use the embedded (HTML) form the first time and then make AJAX requests to the Forms API when visitors click to download the asset again.

 

Customized email sends

 

Are you working out of the HubSpot account ending in "0122?" If so, you have access to these personalized workflow actions. When you say you are not able to use the "Send email" workflow action, could you describe where you are getting stuck?

Isaac Takushi

Alumnus, HubSpot Developer Support

View solution in original post

Reply
0 Upvotes
5 Replies 5
HubSpot Employee

Hi, @pphulariya.

 

To clarify, it sounds like you are trying to migrate from a custom form to a native HubSpot form. So far, you have successfully embedded the HubSpot form on your site, but have yet to find solutions for the four use cases you outlined. Is that correct?

 

If so, I'll try to address your concerns below:

1. Posting HubSpot form data to an external API

 

I'm unfamiliar with the WebEx APIs, but you could use HubSpot's client-side global form events to notify your server of submissions, then retrieve the submission JSON server-side with this endpoint. From there, you could reformat the data and send it to the WebEx service.

 

2. Multiple success message configurations

 

By default, HubSpot forms support limited options for post-submit messaging (usally just an inline thank you message or a redirect), but you could trigger custom client-side JavaScript with global form events, such as onFormSubmitted.

 

3. Form POST actions with unique PDF guids

 

It is not possible to alter the POST actions of embedded HubSpot forms, so you would likely have to use a combination of global form events and server-side calls to retreive the correct download link.

 

If this limitation is too great, I would recommend retaining your custom form and hooking it up to HubSpot via the Forms API (not relying on an embedded HubSpot form).

 

4. Confirming if submit action is successful

 

You can listen for the onFormSubmitted global form event.

 

To address your final point, I don't think HubSpot webhooks would enable your use case.

Isaac Takushi

Alumnus, HubSpot Developer Support
Reply
0 Upvotes
New Contributor

Hi @IsaacTakushi ,

Thanks for sharing this, even I am going ahead with global events only. few more doubt:

We are using google ad campaign tracking,conversions and analytics when someone submit form or download a pdf post form submissions then do we need something different.

Secondaly, we have an existing functionality where user fills up a asset (example: datasheet, whitepaper pdf ) download form only once to dowload pdf, but on consequtive downloads  there is backend form submission and user s presented with download link in success message.

I want to replicate the same, but I am not sure if we can achieve this? 

Reply
0 Upvotes
HubSpot Employee

Hi, @pphulariya.

 

Sincere apologies for the delayed response.

 

If I comprehend your use cases correctly, I think both are possible:

 

1. Custom Google tracking

 

You can trigger Google scripts like Google Ads conversion tracking tags when visitors submit forms with the onFormSubmit or onFormSubmitted global form events.

 

HubSpot global form events will not help with the document download use case, but if your visitors click custom HTML buttons to download PDFs, you could add JavaScript event listeners to them which trigger custom event tags.

 

2. Hiding forms on consecutive downloads

 

HubSpot forms have a "Pre-populate fields with known values" setting (see the Customize your form options section of this article). If your goal is to hide the form fields if visitors have already completed the fields (or they are otherwise known), then could you enable this setting and hide the fields with JavaScript if they contain known values?

Isaac Takushi

Alumnus, HubSpot Developer Support
Reply
0 Upvotes
New Contributor

Hi @IsaacTakushi ,

That was a very helpful advice. I am following the same approach.

I have few more doubts like:

I am rendering the Asset Download form in various pages as an ajax call when some one click on asset download button, in that case will the values be persisted? The logic is: if a user fill the form then no matter which page user is in the user dont have to submit form again, that is once filled the form then clicking on the asset will submit the form in background and user will only see the asset download link.  In short can we submit this form from jquery in background without rendering the form?

 

Custom Send Email Action to Email field of Contact US form onFormSubmit

I have a contact us form which has an email field, I am able to register lead whenever some one fills the form, I also get a email notification. Now I want to send notification email to user abot the form submitted with the personal details captured.

I have browsed through multiple artiles like setting up a workflow action to send personalized email using personalised token etc, but I am not able to do that, I am sure its just the configuration which I am not aware of.

Reply
0 Upvotes
Solution
HubSpot Employee

Hi, @pphulariya.

 

Sincere apologies for the delayed response.

 

Submitting a hidden form on repeat downloads

 

I don't know of a way to submit a completely hidden embedded HubSpot form, but you can certainly make AJAX requests to this v3 Forms API endpoint for repeat submissions to the form. The API submissions are capable of updating contact records the same way as the HTML form. Said differently, you might have to use the embedded (HTML) form the first time and then make AJAX requests to the Forms API when visitors click to download the asset again.

 

Customized email sends

 

Are you working out of the HubSpot account ending in "0122?" If so, you have access to these personalized workflow actions. When you say you are not able to use the "Send email" workflow action, could you describe where you are getting stuck?

Isaac Takushi

Alumnus, HubSpot Developer Support

View solution in original post

Reply
0 Upvotes