APIs & Integrations

ajay1
Participant

Forms API - when to use + using contact reconversion

Hi community,

 

I have an HTML (contact us) form which needs JavaScript to be attached to the submit button in order to display a 'success' message to the user without reloading the page (given that this is a single page application). My understanding is that in this scenario I have to use the Forms API instead of using the automatic form collection feature that's provided. Is that a correct assumption?

 

Assuming that is the case, my second question is... With the automatic form collection, contact reconversion happens automagically when the users uses a different email address to the one they'd used previously. Using the Forms API is there a way to handle contact reconversion in the same way?

 

Big thanks for any help.

 

Adam

0 Upvotes
1 Reply 1
acurtwright
HubSpot Employee
HubSpot Employee

Forms API - when to use + using contact reconversion

Hi Adam! 

 

Since our non-HubSpot forms collection tool does not support forms with JavaScript attached to the submission event, you're correct that the Forms API would be your best bet in transferring form submission data to HubSpot. 

Automatic reconversion works by merging property and analytics information for visitors based on cookies (more specifically, their HUTK value) included with the conversion data.

If you want to merge visitors with the same cookie while using the Forms API, you'll want to ensure that the hutk parameter is included in the call's request body. This allows HubSpot to merge visitor profiles and recognize returning contacts using the same mechanism that's enabled by default for automatic form collection. The HUTK parameter should be placed in the Context section of the request body; you can view a sample request here.

Hope this helps!