Skip to content
Default help center home
Default help center home

HubSpot Forms

Capture website leads instantly without requiring a traditional form. Simply add our JavaScript snippet to your header tag to begin collecting visitor responses. See below for more instructions.

HubSpot Forms are used by customers like Spot AI!

Implementation

Step 1: Connect your Webform

Go to Navigation > Forms > Webforms. Select the Connect your Webform option.

Step 2: Select HubSpot form

Choose HubSpot as your form type and copy the provided snippet. Your engineering team will need to add this snippet to the <head> section of your webpage.

Your snippet should look something like this:

<script> (function(w, d) { w.__default__ = {team_id: xxx, form_id: xxxxx}; var s = d.createElement('script'); s.async = true; s.src = 'https://import-cdn.default.com/v2/index.js'; d.head.appendChild(s); })(window, document); </script> ​

Step 3: Identify your form

Specify how you’ll identify the form on your webpage by choosing one of these methods:

  • Adding the unique identifier to your <form> tag.

  • Adding the code to your form wrapper.

  • Place a <div> around your form.

Then select β€œI have my form identification.”​

Step 4: Test connection

Test your setup by submitting a sample response through your web form. After submission, map all required fields to complete the configuration.

Warning: Make sure your HubSpot form is not redirecting to another page on form submission, otherwise that will prevent Default from being able to parse your responses.​

Step 5: Map form fields

Map the Email field from your form submission when prompted. This is a required field for all forms. Other fields can be mapped to Default lead attributes.

Note: Not all of your form fields need to be mapped to a Default field attribute.​

Event callbacks

Our webform script also offers the ability to listen to form submissions and meeting bookings, so you can pass that data on to other frontend integrations through JavaScript callbacks:

// Register a callback on form submission window.__default__.onSubmissionSuccess((response) => { console.log('Form submitted successfully!', response); }); // Or register all callbacks at once window.__default__.registerSubmissionCallbacks({ onSuccess: (response) => console.log('Success!', response), onError: (error) => console.error('Error:', error), onSchedulerDisplayed: (data) => console.log('Scheduler shown'), onSchedulerClosed: (data) => console.log('Scheduler closed'), onMeetingBooked: (data) => console.log('Meeting booked!', data.payload), onRedirect: (data) => console.log('Redirecting to:', data.redirectUrl) });

HubSpot Form examples​

Spot AI

default-hubspot-form-spotai.png