Skip to content

Instantly share code, notes, and snippets.

View felixmacaspac's full-sized avatar
🎯
Focusing

Felix Macaspac felixmacaspac

🎯
Focusing
View GitHub Profile

Overview

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.

A note on the HubSpot cookie: hubspotutk

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

@felixmacaspac
felixmacaspac / felixmacaspac_uses.md
Last active January 4, 2023 10:49
Inspired by Wes Bos's uses.tech, Here is my current setup.