Website & Development
Connecting your website to your CRM (HubSpot/Salesforce): forms, tracking and lead flow
Copy for AI
Connecting your website to a CRM like HubSpot or Salesforce is done in two ways: you embed the CRM’s native forms, or you build your own forms and send the submitted data through to your CRM via the API. The first option is faster and populated almost flawlessly, the second gives you full control over design, speed and validation but requires more development. In this article you will read which connection option fits when, how to set up reliable tracking and attribution, and how to build your lead flow so that no leads or data get lost along the way.
This is exactly the work we steer on: a website that turns visitors into leads your sales team can actually follow up, with a clean connection to the system where that follow-up happens. It fits within the broader choices from our guide to having a B2B website built.
What does connecting your website to your CRM mean?
A connection means that a completed form on your website automatically creates a contact or lead in your CRM, with the right fields, source and owner. No export files, no manual re-typing, no leads left sitting in a mailbox.
In practice, such a connection consists of three layers that you have to set up independently of one another:
- The form layer. The form the visitor fills in and the data you collect.
- The tracking layer. The code that measures where the visitor came from and what they did on your site, so you attach context to the lead.
- The routing layer. The rules that determine who the lead is assigned to, what status it gets and what follow-up starts.
Most problems arise because companies only think about the first layer. The form works, but the source is empty, no one feels like the owner and half the context has disappeared along the way. A good connection is therefore just as much a process matter as a technical one.
Which connection options do you have: native forms or custom forms with the API?
There are two main routes, and the difference largely determines how much control and how much maintenance you get.
Embedding your CRM’s native forms. You build the form in HubSpot or via Web-to-Lead in Salesforce and place it on your website via an embed snippet. The big advantage: the data arrives guaranteed and in the right field in your CRM, because the form talks directly to the system. You need no intermediate code that can break. The downside: you are bound to the styling, validation and possibilities of the CRM. With HubSpot, forms on the free tools carry HubSpot branding by default, and the layout cannot be bent endlessly to your visual identity. Salesforce Web-to-Lead is functional but visually bare, and has a standard limit of 500 leads per 24 hours (additional requests land in a queue rather than getting lost).
Building your own form and sending it through via the API. You build the form yourself in your website, exactly in your visual identity and with your own validation and speed, and send the submission to your CRM via the Forms API (HubSpot) or the REST API (Salesforce). The advantage: full control over design, performance and user experience, and your form loads together with your own fast page instead of as an external widget. The downside: you need development, and you have to account for API limits. HubSpot, for example, enforces a rate limit on the unauthenticated submission endpoint, so at high volume you have to handle that deliberately. Moreover, a custom connection is something you maintain: if a field changes, the mapping has to follow.
A commonly used middle way is a hybrid: a custom form for the user experience, but the submission via a reliable server-side call to the CRM API, so you combine the best of both worlds. Which route fits depends on your team and your growth plans, not on what happens to be quickest to demonstrate.
If your site runs on Webflow, there are specific ways to tie forms and HubSpot together neatly. Dig into connecting Webflow to HubSpot to get the leads out of your forms.
How do tracking and attribution work after the connection?
Tracking ensures that every lead in your CRM comes with context: where the visitor came from, via which campaign, and which pages they viewed before filling in the form. Without that context your sales team does not know who is warm, and marketing does not know which channel works.
With native forms the CRM tracking script handles this largely on its own, provided the script is correctly present on every page. With your own forms you have to send the source and campaign data (for example UTM parameters and the original referring channel) yourself as hidden fields in the API call. If you forget that, every lead comes in as “direct” or without a source, and your attribution is worthless.
Three things to get right here:
- Put the tracking script on every page, not just on the thank-you page. Otherwise the CRM misses the path that led to the conversion.
- Store the first source, not just the last. B2B purchases take a long time; someone can come back five times before filling in the form.
- Test the mapping with a real submission. Fill in your own form and check in the CRM whether every field, source included, lands correctly.
How do you set up lead routing without data leaks?
Lead routing is the automatic assignment of every incoming lead to the right person or the right team, with the right status. This is where, in practice, most leads get lost, not at the form itself.
The classic leaks you close off in advance:
- Duplicate contacts. Without deduplication on the email address, you create a new record on every submission, and the history becomes fragmented. Set up deduplication before you go live.
- Leads without an owner. A lead that comes in but is assigned to no one stays put. Define a clear assignment rule and a safety net for the case where a rule does not match.
- No follow-up trigger. A lead in your CRM is not follow-up. Attach a notification or task to every new lead, so that follow-up starts within your promised response time.
- Silent failures. With a custom API connection, a call can fail without anyone noticing. Build in an error message or fallback (for example a backup via email), so that a lead submission never disappears in silence.
A well-designed contact page and form flow should connect to this seamlessly: the form captures the lead, the connection brings it in, and the routing ensures that someone responds within a working day.
What about GDPR and consent with CRM tracking?
Tracking and CRM connection fall under the GDPR, so you process personal data and you need a legal basis and transparency. The practical rule of thumb: do not load non-essential tracking scripts until after the visitor has given consent, and be clear in your form and privacy statement about what you do with the data.
Concretely, that means: link your CRM tracking script to your cookie consent tool, so it only activates after agreement, and only ask on the form for the data you truly need for the next step. That last point is not only proper for privacy, it also raises your conversion, because every superfluous field costs you leads. The less you ask, the more people fill in, as we work out in conversion optimization of forms. If you are in doubt about the correct legal interpretation, put it to someone with privacy expertise; this article is not legal advice.
When do you choose native forms and when your own forms?
It depends on your team, your volume and how much the form is part of your brand experience. An honest trade-off:
- Choose native forms if you want to go live quickly, have no developer on standby, and reliability comes before customization. For many SMEs this is the sensible start: the connection just works, and your time goes to follow-up instead of maintenance.
- Choose your own forms with the API if design, speed and user experience are critical, your volume is high, or your forms are an important part of your conversion path. You pay for this with development and maintenance, but you get full control in return.
- Choose a hybrid if you want the look of your own forms with the reliability of a direct CRM connection, and you have the development capacity to maintain that neatly.
There is no fixed answer here that is right for everyone. Just as with the choice between a traditional and a headless CMS, the rule is: let your goal and your situation decide, not the trend or the vendor’s preference.
The short summary
Connecting your website to HubSpot or Salesforce is not a matter of one button, but of setting up three layers well: the form, the tracking and the routing. Native forms are fast and reliable, your own forms give control, and a hybrid combines both. The real work is in the lead flow that follows: deduplication, a clear owner, a follow-up trigger and a safety net for failed calls, so that not a single lead disappears in silence. Set up tracking and consent properly from day one, and choose the connection that fits your team and your growth.
Do you want this set up neatly, from a conversion-focused form to a clean CRM connection? Take a look at our approach to website development or book your free intro call.
Free website scan
Enter your website and get an automatic scan within minutes, with concrete technical and SEO improvements. No sales pitch.
We only use your details for your scan. No spam, unsubscribe anytime.