I am kind of new to the HubSpot community. I have developed a form for my website. I needed to save contact information via the contact us form to the HubSpot contact object.
Also I needed to use the cookie. I used a tracking code and added a cookie script in the header of my site. Now the problem is there are many validations in the contact us form.
But after the use of cookies, it seemed that even if there are validation issues, partial data of contact us form gets submitted. And HubSpot collects it using form API.
So after that if a user passes the validation and sends the form data again, then the contact doesn’t get saved as HubSpot responds with contact exist type of error message.
After some searching, I figured out about non-hubspot form. I stopped it from the HubSpot panel but now analytics and other staff are no working properly. After going through the documents it seemed like Hubspot used the API for analytical purposes. But in this case, I need to go through validation for my website too.
Is there any way to stop the auto-submission of the form?
Instead of using the tracking script, I would like to advise you to use the form submission API if possible.
If you can somehow make an API request when the form is being submitted, you have full control over when the data is sent to HubSpot.
You can pass the HubSpot cookie (hutk) to HubSpot and it will have all the tracking data included.
Reading the document it says I will need to use the HubSpot tracking code in my website’s header. If I do so, things may remain the same.
As using the HubSpot cookie tracker in the header would make the problem unsolved, In this case how I should proceed?
As I mentioned earlier, I have to check some cases during validation. But problem is, the cookie tracker code which is installed in my site’s header, automatically calls the form API and sends data. So after fulfilling the validation requirement, it seems like I can’t send the form data as the cookie tracker automatical sends the form data beforehand.
So I always get the “contact exists” type of message. This means I need to stop the behavior of the cookie tracker so that it doesn’t automatically send the parital form data and wait for user validation to be completed. Is there any way that I can follow?
Thank you very much for your reply and for reading my message.