Skip to content

Instantly share code, notes, and snippets.

<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
hbspt.forms.create({
portalId: "YOUR_PORTAL_ID_FROM_APP_HUBSPOT",
formId: "FORM_ID_FROM_EDITOR_URL"
});
</script>
@thesnappingdog
thesnappingdog / hubspot-2step-form.html
Last active April 25, 2022 19:27
Two-Step form in HubSpot
<h1>2 Step Form</h1>
<div id="demo-form"></div>
<script charset="utf-8" type="text/javascript" src="https://js.hsforms.net/forms/v2.js"></script>
<script>
var data = []
hbspt.forms.create({
portalId: "YOUR_PORTAL_ID_HERE",
formId: "STEP_ONE_FORM_ID_HERE",
target: "#demo-form",
HAPIKEY_MAIN={COPY PASTE YOUR HUBSPOT API KEY HERE}
HAPIKEY_SAND={OPTIONAL: INCLUDE A SECOND API KEY HERE E.G SANDBOX ACCOUNT}
# Copy paste install code from brew.sh to install Homebrew:
richardmakara$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Python with Brew:
richardmakara$ brew install python
# Install pipenv to manage project dependencies
richardmakara$ brew install pipenv
@thesnappingdog
thesnappingdog / formupdate_script.txt
Last active December 1, 2019 14:33
This is how the form update script works conceptually.
## Imagine a flowchart, but instead of doodles you have variables
forms = connect to your Hubspot account and load __all__ forms you have
forms_to_update = filter out only the forms that you want updated by keyword
form_id = paste the form ID that you want to use as a template.
form_template = request the specific form and all of its parameters with the form_id
form_constants = Some parameters cannot be copied from the template. Bring them along
bulk_update_forms = update forms with the template and constants.