This tutorial will walk you through how to submit to the HubSpot Forms API using Javascript. Check out the documentation for submitting to the Forms API.
- It will use vanilla JS (i.e. no libraries or frameworks) and will provide example code.
- It will assume that you are familiar with HubSpot, HubSpot Forms, and that the HubSpot Tracking Code is on the page.
The HubSpot tracking code is a javascript snippet that is placed on websites. It anonymously collects website visit data, similar to Google Analytics. This anonymous visit data can be associated to HubSpot Contact record through a few means, including sending a usertoken value when submitting data to the Forms API. The tracking code generates a cookie containing a unique usertoken called hubspotutk. The value of hubspotutk will be submitted in our form submission as hutk.
HubSpot uses this cookie value to connect visito
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .eot - application/vnd.ms-fontobject | |
| .woff - application/font-woff | |
| .ttf - application/x-font-truetype | |
| .svg - image/svg+xml | |
| .otf - application/x-font-opentype | |
| IIS (Web.Config) | |
| <remove fileExtension=".eot" /> | |
| <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" /> | |
| <remove fileExtension=".ttf" /> |
