HubSpot with Astro
HubSpot wants to own the form. The site wants to own the design. The right setup depends on the page: sometimes an embedded HubSpot form is best, and sometimes a form of your own should post to HubSpot behind the scenes.
HubSpot at a glance
- What I do
- Connect Astro and HubSpot so forms, contacts, attribution and tracking work without giving up the site's design.
- Typical setup
- Adds 2–4 days
- How it is bought
- Part of a migration scope, or a Continuous development request once the site is yours
- Category
- CRM and email
Setup
How I set up HubSpot
HubSpot is easy to connect badly, and the first decision is which form owns the submission.
An iframe embed hands the whole form to HubSpot: the form retains HubSpot's supported behavior, a change made in HubSpot reaches the site without a deploy, and styling control goes with it. A developer embed keeps that logic while letting the markup be styled in your own components, at the cost of resyncing when the form's structure changes on the HubSpot side. A form of your own connected to HubSpot keeps the design and the interaction native, and is bounded by the field types the chosen route supports.
None of those is the wrong answer, and I pick per form rather than per site, on what the fields, the validation, the tracking and the styling actually need.
The tracking code is just as important as the form. Without it, HubSpot may still receive a submission, but page views, visitor activity and attribution can be incomplete. I verify the whole path: visit, consent, submit, contact creation, attribution and conversion event.
On one build the form submitted and HubSpot created the contact, and the source and campaign never arrived with it. The hidden fields looked populated in the browser, and the form's own code was sending different values, so what HubSpot received was not what had been written into the page.
I now check the saved contact and its attribution as part of every form test: a contact with the expected fields, the attribution that produced it, and the workflow enrollment that was meant to follow.
Which form owns the submission.
A HubSpot form, embedded
- HubSpot owns the form and its supported behavior
- Progressive profiling and smart fields
- A change made in HubSpot reaches the site without republishing it
- Styling control goes with it, unless it is a developer embed
Right when the form's own behavior is the point
Your own form, posted to HubSpot
- The site owns the markup and the interaction
- The design and the validation stay native
- Values sent behind the scenes, with the attribution written deliberately
- Bounded by the field types the chosen route supports
Right when the design is the point
How the handoff works
- 01
Submit
The form posts
- 02
Contact
New contact created, or an existing one updated
- 03
Attribution
Source and campaign checked
Key handoff
- 04
Workflow
Configured workflows triggered
- 05
Verify
Contact details and routing confirmed
Why this is the key handoff
A success state only proves the browser thinks the form worked. I check that the contact arrived carrying its first touch and campaign, and that the workflow meant to handle it actually ran, because a workflow cannot add back what was never captured.
Included
What gets connected
-
Site forms creating or updating HubSpot contacts and deals
-
HubSpot forms embedded where progressive profiling or smart form behavior matters
-
Lifecycle stage, lead source, campaign and custom properties
-
HubSpot tracking code on the site's domain
-
Conversion events and form success behavior
Before you add it
What to watch out for
- 01
Hidden fields on a scripted form arrive empty
Where a framework controls the form, values written into the DOM can disagree with what that framework thinks is there, and HubSpot receives its version. The contact is created, the campaign arrives blank, and every visible part of the path succeeded, which is why the check is on the saved record.
- 02
Embedded forms can need extra styling
A HubSpot form embed carries HubSpot's markup. Making it match the site means overriding styles you do not control, which is fine until they change them.
- 03
The form and the visitor tracking are separate installs
One creates contacts, the other supplies the page views and attribution behind them, so each needs its own check. A contact can arrive successfully while its browsing history or attribution stays incomplete, and the tracking route depends on a script that a blocker or a conflict can stop from loading.
More tools
Keep exploring
-
Salesforce
Site forms that create the right Salesforce records, preserve attribution and fail visibly when Salesforce rejects a submission.
Adds 3–5 days
-
Pipedrive
Send website leads into Pipedrive as complete people, organizations and deals, with source and stage already set.
Adds 2–4 days
-
Mailchimp
Connect signup forms to Mailchimp with correct audiences, merge fields, tags and double opt-in behavior.
Adds 1–2 days
Let me plan your next step.
I can scope a migration. Send a brief and I will reply by email with next steps.